Welcome to WebmasterWorld Guest from 54.162.94.181

Forum Moderators: incrediBILL

Message Too Old, No Replies

using mailto with subject & body pre-filled

How do I do this?

     
7:44 pm on Aug 22, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 15, 2003
posts:266
votes: 0


How do I code a mailto line so that both the subject and body will be pre-filled?

I already know how to get each one working individually:

mailto:me@mydomain.com?subject=my subject
mailto:me@mydomain.com?body=body of email

7:47 pm on Aug 22, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 17, 2001
posts:1262
votes: 0


It's not guaranteed to work, but what you're essentially sending the mail client are CGI variables. Thus you add paramenters with the ampersand (&):

mailto:me@mydomain.com?subject=my%20subject&body=body%20of%20email

8:04 pm on Aug 22, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 15, 2003
posts:266
votes: 0


Cool! Thanks!

Originally posted by choster

It's not guaranteed to work

Are you saying that it will only work some of the time, or only with certain browsers, or did you simply not test it before you posted it?

I tried it and it works for me.

8:07 pm on Aug 22, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2003
posts:2355
votes: 0


It depends what the user has their default Email application set to.
8:19 pm on Aug 22, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 22, 2000
posts:9138
votes: 0


I had some trouble with the %20, particularly in a 10 or 15-word sentence. Try to keep it short and, if possible, hyphenated. It lost a lot on aesthetics, but I needed the functionality.
8:25 pm on Aug 22, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 15, 2003
posts:266
votes: 0


Originally posted by choster

It depends what the user has their default Email application set to.

Gottcha. Thanks.

So it pretty much should work for 99% of the average joe users.

originally posted by rcjordan

I had some trouble with the %20, particularly in a 10 or 15-word sentence. Try to keep it short and, if possible, hyphenated. It lost a lot on aesthetics, but I needed the functionality.

Really? My sentences in the body are comprised of 35 words. What problems did you have? What was your default email client?

8:28 pm on Aug 22, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 15, 2003
posts:266
votes: 0


Had no problem with the 35 word message in the body, by the way. My default email client is Outlook.
9:11 pm on Aug 22, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 22, 2000
posts:9138
votes: 0


>My sentences in the body are comprised of 35 words. What problems did you have? What was your default email client?

Eudora, but I didn't have the problem. I was, however, receiving email with the pre-filled body content truncated --probably where their email client window made the first line wrap, but that's just a guess.

9:18 pm on Aug 22, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 15, 2003
posts:266
votes: 0


I was, however, receiving email with the pre-filled body content truncated --probably where their email client window made the first line wrap, but that's just a guess.

OK. Cool. As long as the content that they type in their reply comes through, I'm good. Thanks.

10:23 pm on Aug 22, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 17, 2001
posts:1262
votes: 0


FYI Outlook and Mozilla seem to accept the fields cc= and bcc= as well.
10:35 pm on Aug 22, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 15, 2003
posts:266
votes: 0


FYI Outlook and Mozilla seem to accept the fields cc= and bcc= as well.

Cool. How would I incorporate those into the coding?