Welcome to WebmasterWorld Guest from 54.234.153.186

Forum Moderators: incrediBILL

Message Too Old, No Replies

using mailto with subject & body pre-filled

How do I do this?

     

LABachlr

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

10+ Year Member



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

choster

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

WebmasterWorld Senior Member 10+ Year Member



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

LABachlr

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

10+ Year Member



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.

bcolflesh

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

WebmasterWorld Senior Member 10+ Year Member



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

rcjordan

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

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



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.

LABachlr

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

10+ Year Member



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?

LABachlr

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

10+ Year Member



Had no problem with the 35 word message in the body, by the way. My default email client is Outlook.

rcjordan

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

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



>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.

LABachlr

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

10+ Year Member



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.

choster

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

WebmasterWorld Senior Member 10+ Year Member



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

LABachlr

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

10+ Year Member



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

Cool. How would I incorporate those into the coding?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month