Jump to content

Sending an email from a form doesn't work for Safari, but it does work for Firefox - help!


Guest gscholl

Recommended Posts

Guest gscholl

Hi there all those who know WAY more about this HTML stuff than I could ever dream of! I used the following code to create a form on our Chamber website for people to use to request our brochure sent to them. The problem is, it works in Firefox, but in Safari (haven't tested in other browsers yet) the form doesn't populate the email with the data entered. It's just blank. What am I doing wrong? Is this a case where I need to use XHTML or something? <html><body><form action="MAILTO:info@hoodriver.org?subject=Website: Please Send Me a Visitors Information Packet"method="post" enctype="text/plain"><h3>Please enter the following information to request your free Hood River County visitor information packet. </h3>Name:<br><input type="text" name="name"value="Your Name" size="20"><br>PO Box or Street Address<br><input type="text" name="PO Box/Street Address"value="PO Box/Street Address" size="20"><br>Address Line 2<br><input type="text" name="Address Line 2"value="Address Line 2" size="20"><br>City<br><input type="text" name="City"value="City" size="20"><br>State<br><input type="text" name="State"value="State" size="20"><br>ZIP Code<br><input type="text" name="Zip Code"value="Zip Code" size="20"><br>Country<br><input type="text" name="Country"value="Country" size="20"><br>Need extra information?:<br><input type="text" name="Extra information"value="Please send me extra informaton on..." size="40"><br><br><input type="submit" value="Send"><input type="reset" value="Reset"></form></body></html>I would really appreciate your help!!! Gen

Link to comment
Share on other sites

Hmm, I don't have Safari so I can't test this, but it may be because of the spaces. When you run this code in Safari, does the subject become "Website:" rather than "Website: Please Send Me...."?If so, you might try adding this script in the head section:

<html><head><script type="text/javascript">function encodeAction(obj){	var action = obj.action;	obj.action = encodeURI(action);}</script></head><body>

And then, in your form, add an onsubmit like this:

<form action="MAILTO:info@hoodriver.org?subject=Website: Please Send Me a Visitors Information Packet"method="post" enctype="text/plain" onsubmit="encodeAction(this);">

I hope this helps.===================================================After more thought, it may be because of the way you are using the MAILTO.Check out this link: http://www.ianr.unl.edu/internet/mailto.htmlIt explains that in order to get the data in the form into the body of the email, you should specify the body in the mailto link like so:mailto:my@emailaddress.com?subject=This%20is%20the%20subject&body=This%20is%20the%20bodyThe %20 is a url-encoded space.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...