PDA

View Full Version : Pre-formatting "mailto" entries


saeed
10-28-2002, 05:35 AM
Guyz, look at the code below:

<a href="mailto:webmaster@yourdomain.com?subject=my_subject&body=Dear Sir, we had revice your mail and will respond you soon">mail me</a>

now I want to continue my further message after Dear Sir, in a new line ... how can this be happen in javascript ... is html is enough for this functionailty or I have to use javascript.

waiting for a reply.

whammy
10-28-2002, 05:39 AM
Actually, javascript can do this, but it is not reliable across different email clients.

If you REALLY want to format your messages you'll need to use a server-side language (because of bugs in MS Outlook Express, and differences in the way that email clients handle javascript)... but for what it's worth:

http://developer.netscape.com/viewsource/husted_mailto/mailto.html

... is pretty much the definitive answer to your question.

:)

P.S. I'm not picking on your English (because my knowledge of your language is limited to the english spelling of Hello... "Namastai" (sp?), and I have a good friend from Pakistan, he is the nicest guy you'd ever want to meet. ;)) - but your message might be a little better worded something like this:

Dear Sir,

We have received your email and will respond as soon as possible.

In the meantime, many common questions can be answered by visiting our "Frequently Asked Questions" page at the link below:

http://www.somewebsite.com/faq.htm

Thank you,

YourNameHere
etc...

glenngv
10-28-2002, 05:50 AM
to give you an idea of what whammy is saying, here's an old thread that has the same problem as yours:

http://codingforums.com/showthread.php?s=&threadid=3502

whammy
10-28-2002, 05:57 AM
Great post, Glenn.

That thread describes one of the problems I ran into with email clients and using javascript to format an email message very accurately!

Another problem I ran into in addition to that was if the TOTAL of the values of my form variables were too long, then MS Outlook Express (perhaps the most commonly used email client?) wouldn't send the email - instead it gives you some kind of cryptic error (I forget what it says - but basically it just gives you an error alert, and that's it).

I never did figure out how many characters it allowed before bugging out, but it wasn't that many. Less than 1,000, and perhaps less than 500?

:rolleyes:

saeed
10-28-2002, 07:22 AM
hello,
thankx a lot whammy & glenngv for replying my thread ... but the problem still exists I am using IE 5.5 and Outlook 5 and can't use these options while using IE 5.5 although this is working perfectly in Netscape.

hoping for a better idea from you guyz.

anyways thankx a lot !

whammy
10-28-2002, 11:44 PM
There is no better idea, except for the one I already posted - using a server-side language. If you aren't familiar with any, I'd probably suggest learning PHP or ASP, as those are probably the two easiest to learn.

:)

Pooh
10-29-2002, 12:37 AM
http://www.webreference.com/js/column70/3.html

whammy
10-29-2002, 01:46 AM
That's the same thing... actually it looks like someone read the page I posted and reformatted it (and if that's the case, they did it badly, since it isn't correctly formatted HTML, not to mention the fact if I worked with whoever that guy is, I'd have to strangle him since he doesn't indent his code.. it looks like something half-human and half machine generated, and I would totally rewrite it (if it worked, which I know it doesn't)!).

JavaScript is NOT the solution for sending preformatted email messages. It just doesn't work with all email clients. And the link posted above will have the same drawbacks as any other mailto solution.

:D