Click to See Complete Forum and Search --> : Mailto: Link question - simple.... i think.
FIN23
12-04-2005, 09:31 AM
HI all
New to this forum and its a very good place to be!
I have a quick question for all you very clued up people..
I have a web site with a SWF contact us icon , which, when clicked opens the clients email program and sends a mail.
I really want to put information within the blank message being opened on thier machines, like Subject line info and i also want to add some body text , i.e. to remind poeple to include certain things within their mail to me.
Can anybody help?
Cheers
FIN
thewebman
12-04-2005, 09:55 AM
<a href="mailto:youremail@yahoo.com">email me</a>
FIN23
12-04-2005, 10:03 AM
thanks for your quick reply.
Mailto link is not the problem.
I want subject lines to read 'gimme a quote'
and body of the Mail being sent to read something like
" please dont forget to add personal details to this mail"
just to remind people of what they have to put in their mails to me. when they click the mailto icon.
bathurst_guy
12-04-2005, 10:14 AM
<a href="mailto:email@email.com&subject=gimme a quote&body=please dont forget to add your personal details to this email">email me</a>
BUT you should do this server side using PHP mail function
thewebman
12-04-2005, 06:50 PM
Mailto link is not the problem.my bad.
FIN23
12-05-2005, 04:07 PM
my bad.
No probs mate! Thanks for quick reply!
adding "mailto:email@email.com&subject=gimme a quote&body=please dont forget to add your personal details to this email"
within my href causes all of the above to be added to the address line... not the subject and body..
I dont think my web host package gives me a PHP option.. not knowing PHP i never paid for it.. any other way around?
thanks for quick replys guys!
welsh
12-05-2005, 06:33 PM
try:
<a href="mailto:someone@email.com?subject=Hey a subject line&body=please dont forget to add your personal details to this email">Email Me</a>
FIN23
12-06-2005, 03:15 AM
That worked , Thanks a lot for that!!
FIN23
12-06-2005, 03:26 AM
quick question then, why must this be done with PHP really? seems a nice easy link to add as HTML..?
john1001
12-06-2005, 03:46 AM
Hiya FIN, what about something like this...
Create a form around your swf button and make the action mailto:... as normal, like this => but include in the form a couple of boxes for your visitor to put in their details, name, address, etc. Remember to include a HIDDEN input tag set to empty string. Then using the routine below you load this tag with your gathered form data. The snippets below are from a garage website I did recently.
<form name="contactform" method="post" action="mailto:sales@ [realaddress] .co.uk?subject=Web_enquiry_form"
enctype="text/plain" OnSubmit="return validate(this)">
Okay then in the validate() routine you assemble all your data and drop this back in the body of the email thus.
if(detailString)
{
var exp = /[<>%^&*@#]/g
form.Description.value=detailString.replace(exp,"");
}
form.Email.value.toLowerCase();
form.Email2.value.toLowerCase();
var finalString = "You have an e-mail from the contact page of your website\n"+
"\nThe sender is:- "+form.Name.value+"\nE-Mail address:- "+form.Email.value+"\nEmail check:- "+form.Email2.value+
"\nAddress:- "+form.Address.value+"\nCity:- "+form.City.value+"\nPost Code:- "+form.Pcode.value+
"\nTel Number:- "+form.Tel.value+"\nMobile:- "+form.mobile.value+"\nChassis:- "+form.Chassis.value+
"\nYear:- "+form.Year.value+"\nMake:- "+form.Make.value+"\nModel:- "+form.Model.value+
"\nBody Colour:- "+form.bodyCol.value+"\nBody Type:- "+form.bodyType.value+"\nGearbox Type:- "+form.gBox.value+
"\nEngine Size:- "+form.Engine.value+"\nFuel Type:- "+form.Fuel.value+"\nDescription of Enquiry:-\n\n"+form.Description.value+"\n\n\n";
form.finalmessage.value=finalString;
return true;}
PLEASE understand the above is only snippets, you will have to modify the code to meet your own needs, with a little care you can make a nicely formatted email for your customer without resporting to PHP or ASP.
Regards John1001
jvalerie
12-10-2005, 12:17 PM
I've been trying to figure out how to add a subject line and this easily answered my question too. I'm new to this site, and it looks like a great place for help!
MarkMitch
12-29-2005, 02:29 PM
Hi, im really interested in this code as im trying to get an action="mailto..." form to work better on a webserver with no allowance for asp (my language of choice!) or php.
What sort of language is that you are using above John?
many thanks!
felgall
12-29-2005, 02:59 PM
action=mailto only works on older browsers where there is a separate mail program on the same computer. A lot of places (eg. internet cafes) don't have such a program.
Also specifying mailto in your page will result in 99.9% of all emails you receive being spam.
To avoid spam add the email address in the server side script that converts your form into an email.