Click to See Complete Forum and Search --> : client-side mail-to challenge! Pls help!


munna
08-14-2003, 08:07 AM
Hi,
I am a relative newbie to web-related programming, but would like to make an web version of the "while you were out" phone message pads -- the kind where you can put in the caller's name, number, check a few boxes to show whether he/she will call again etc, and then e-mail it to whoever missed the call. I want to use the mailto command since I want to send the actual formatted e-mail through the sender's e-mail program, and I want it to be basically client-side as much as possible (I know that asp101.com has a similar code, but that would mean putting an asp code on the server) . Can anyone tell me how to do this -- or better still, direct me to any code that does this kind of thing?
Many thanks,
Munna
(I had posted a message about this before, but not with much success -- I would really appreciate any help anyone can offer)

Khalid Ali
08-14-2003, 08:54 AM
if you want to send mail using mailto:command in form action attribute thats prety simple

just followthis pattern

<form id="form1" action="mailto:yourEmail@mail.com" onsubmit="" method="post" enctype="text/plain">

The only problem with this format is that you will get the mail in a very simple format

formFieldName = value
formFieldName = value
formFieldName = value

etc..

And you can not change it.

munna
08-14-2003, 09:24 AM
Dear Khalid,
that's just it! formatting the e-mail without resorting to server-side code is my problem!
If you look at the two txt files, you'll see that the first one "workingphonemsg" works, but sends the form like you said -- in element=value pairs, which can be quite awkward-looking since I've got quite a few checkboxes etc in the form. I thought I'd use values from the first form to put together a single variable called "message", put that in the body of a second hidden form, and set it so that when someone clicks 'send' on the first form, it is actually the second form with its single, neatly formatted 'body' containing 'message' that is sent. But this doesn't work, and I don't know whether its because its impossible to do this in javascript, or because my limited knowledge of javascript is just not up to the task!
Please can you or any of the other experts on the forum have a look?
Thanks so much
Munna

munna
08-14-2003, 09:57 AM
sorry-- forgot to upload the 2 files last time! here's the first one

munna
08-14-2003, 10:00 AM
...and here's the second!
sorry about this once again!

Khalid Ali
08-14-2003, 11:17 AM
Originally posted by munna

that's just it! formatting the e-mail without resorting to server-side code is my problem!
Munna

Unfortunately,Browsers do not allow any formatting to be done on mailto formats.As a matter of fact mailto is not even a recognised standard,its that only NS and IE both support it.
I'd say use server side for formatting or you are stuck with the default style.