View Full Version : HELP_html email link with set subject & body content
atlantajunction
06-29-2005, 09:05 PM
When you have a link that says "Email Me" on a web page, and when the email pops up the subject is already typed in. I know how to do that....
QUESTION: Is there a way to set it so you also have a particular text in the body of the email and/or a form already typed in for your customer?
I figure if you can do the subject that way there must be a way to do the text of the message that way too...does anybody know???
I NEED YOUR HELP PLEASE!!!!! THANKS!
cr3ative
06-30-2005, 06:47 AM
Using mailto, you can see how this template works:
<a href="mailto:YourName@YourSite.com? cc=someone@YourSite.com&bcc=someoneElse@YourSite.com &subject=Shipping%20Information%20Request&body=Please%20tell%20me%20if%20my%20order%20has%20shipped!">Shipping Request</a>
cr3ative
atlantajunction
07-08-2005, 06:39 PM
:D Thank you so much!! :)
1 more question regarding the above topic...
In the prepared email I was wanting to put a "form" (html) in the body so it would be easier for my customers to place their order. Is this possible? Or no?
Thanks for your help...erica
Yes.
You can use a server-side script (preferably) to send it, or you can use an action=mailto: form. However, be aware that this approach is somewhat unreliable, and the actual email received will be urlencoded. For example, if someone typed "My email is user@domain.com" in an input called message, it would appear to you as:
message=My+email+is+user%40domain%2ecom
This would be achieved like so:
<form action="mailto:webmaster@mysite.com">
<input type="text" name="message"/><br/>
<input type="text" name="name"/><br/>
<input type="text" name="email"/><br/>
<input type="submit"/>
</form>
So if someone was to fill in "Hello there," "John Smith," and "john@fsmail.net" respectively, you would (depending on browser) receive a message with an attachment called something like "attach.dat" containing:
message=Hello+there&name=John+Smith&email=john%40fsmail%2enet
This is very unreliable. In fact, don't do it. I just tested it in Firefox, and it didn't like it at all.
Try something in JavaScript - sorry, Mike, ECMAScript - like so:
<script type="text/javascript">
var to = "me@mydomain.com";
var re = "Message to the Webmaster";
function submitMailForm() {
var tform = document.mailform;
window.location = "mailto:" + to + "?Subject=" + escape(re) + "&body=" + escape(tform.message.value) + escape("\n\n") + escape(tform.name.value) + " (" + escape(tform.email.value) + ")";
}
</script>
<form name="mailform" onsubmit="submitMailForm();">
<input type="text" name="message"/><br/>
<input type="text" name="name"/><br/>
<input type="text" name="email"/><br/>
<input type="submit"/>
</form>
decay
07-12-2005, 11:49 AM
Hi, How about trying this?
<a href="mailto:test@example.com?subject=Hello&Body=This%20is%20line%20one%0A%0Athis%20is%20line%20two%0A%0Aand%20this%20is%20line%20three.">Click here to Email me</a>
It works for me in Outlook...not tested it across other email clients though. :confused:
Decay.
atlantajunction
07-12-2005, 07:35 PM
Thanks a lot...I will try this
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.