Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mailto: links 6

Status
Not open for further replies.

katiekat

Technical User
Jun 6, 2000
300
US
Hey guys,

Is there a way to specify a subject and perhaps some text in the email body when you use a mailto: link?

So if you clicked on the link, whatever email form would come up, and it would put something in the subject line for the user.

Thank you for your help! :)

Kate Holy tek-tips batman!:-0
 
katieKat,

You can do something like:

<a href=&quot;mailto:katieKat@Kat.com?subject=My Mail Subject&body=My mail body&quot;>Mail Me!</a>
Mise Le Meas,

Mighty :)
 
THANKS!! :) Works like a charm. Holy tek-tips batman!:-0
 
Description:
Create comprehensive mailto links using the instructions and code shown below. Configure To, CC, Bcc, Subject, and Body information!

Directions:
Below you will find the code required to create a complete mailto link. Read a little about the configurations that are possible so you will know how to edit the code.

mailto: can do more than provide a way to send email to you from your site. When used as an <A HREF> tag, one email can be sent to multiple addresses. Not only that, but any combination of those addresses can be tagged as To: (regular), Cc: (carbon copy), or Bcc: (blind carbon copy) addresses. You can also set default text for the Subject: line and the email body!

Mailto links can send email to multiple recipients. Add additional email addresses after the first, separated by a comma:

Code:
example: <a href=&quot; mailto: email1@email.com, email2@email.com, email3@email.com&quot;>

You can select additional email commands as well:

Sender is the person who selects the mailto: link
Recipient is the person who will receive the mailto: email

TO ( same as using comma in the mailto: line)
Recipient's name will appear in the To: line, along with all the other To: addresses. Sender will see all addresses in the To: line. Recipient will see all addresses in the To: line. Can be changed by Sender.
CC ( carbon copy)
Recipient's name will be in the Cc: line, along with all the other Cc: addressees. Sender will see all addresses in the Cc: line. Recipient will see all addresses in the Cc: line. Can be changed by Sender.
BCC ( blind carbon copy)
Recipient's name will appear in the Bcc: line, along with all the other Bcc: addresses. Sender will see all addresses in the Bcc: line. Recipient will see no addresses in the Bcc: line. Can be changed by Sender.
SUBJECT ( default text for subject line)
Text following this command will appear in the Subject: line. Can be changed by Sender.
BODY ( default text for email body)
Text following this command will appear in the Body of the email. Can be changed by Sender.

Code:
Here is an Example:
<a href=&quot;mailto:contact@cgiscript.net, contact1@cgiscript.net?subject=Mailto Test Subject text&cc=contact3@cgiscript.net&bcc=contact4@cgiscript.net&body=Test mailto body message&quot;>Test Mailto Link</a>

» » » » » »
Mike Barone
FREE and Pro CGI/Perl Scripts

FREE Scripts
 
You can also create carriage returns in the body of your email messages by using %0d.

<a href=&quot;mailto:katieKat@Kat.com?subject=My Mail Subject&body=My mail body%0dHi Guys!%0d&quot;>Mail Me!</a>
 
Hi,
I am tying to format the text used in body part of mailto.
I am trying to have a line break in the body text but it appears that it is comming in one continuous text stream.
How should i implement that?

also how should i automatically send the email.
 
Read the post in this thread by &quot;g-ro (Visitor)&quot; for info on carriage returns. Mike Barone
FREE CGI/Perl Scripts & JavaScript Generators
Ace PopUp Generator Software - Totally FREE
 
I'm Sorry,

I'm missing something here. I am trying to set up a simple maito form with 8 fields of data to send to one email address.

I have tried using the maito code above written by Mike but I Just Cannot get it to work :(

Here is what I have:

Code:
<a href="mailto:deanellis@iprimus.com.au?Subject=SEC:UNCLASSIFIED&Body=Test message"></a>

I have placed this href around the submit button, around each field, and around the entire form, but nothing happens! I get no email.

What am I doing wrong.

Rank amature here.

Cheers

Dean

I'd give my right arm to be ambidextrous!
 
Dean,

it works for me when I use it to make a LINK. I just typed 'mail me' inside the anchor as such:

Code:
<a href="mailto:deanellis@iprimus.com.au?Subject=SEC:UNCLASSIFIED&Body=Test message">[b]mail me[/b]</a>

Give that a shot. I'm using IE6, if it matters.

--Dave
 
In order to send information from a form, you need to put the 'mailto' in the ACTION of the '<form>' line.

Example:
Code:
<form action="mailto:you@example.com" method="GET">

Ken
 
Oops, I forgot Dean's question when I looked at his anchor tags and typed an unuseful answer.

Dean, what you wanted DOESN'T work for me in the answer I posted above.

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top