Jump to content
Caitlin-havener

mailto submit form

Recommended Posts

Why is my mailto not working? I also tried it lowercase.

<form action="MAILTO:caitlin-havener@hotmail.com?subject=Attention%20Contact%20from%20Havener.me" method="post" enctype="text/plain">  Name: <input type="text" name="lastname" /> <br />  Email: <input type="text" name="email" />  Phone: <input type="text" name="phone" /> <br />   Message: <br />  <textarea rows="10" cols="30"></textarea><br />   <input type="submit" value="Send" /> </form>

Share this post


Link to post
Share on other sites

The mailto protocol doesn't take form values, it wouldn't know what to do with them. Your <textarea> doesn't have a name attribute.If you want total control over e-mail sending then you will have to use a server-side language.

Share this post


Link to post
Share on other sites
The mailto protocol doesn't take form values, it wouldn't know what to do with them. Your <textarea> doesn't have a name attribute.If you want total control over e-mail sending then you will have to use a server-side language.
is this outdated? http://www.w3schools.com/tags/tryit.asp?fi...yhtml_form_mail

Share this post


Link to post
Share on other sites

mailto: was never a very good protocol anyway. I've noticed that different browsers support it in different ways. It also depends on users having already set a mail client or URL in their browser. A lot of people haven't done that, and when a dialog comes up asking them to, they get confused and cut short the process.This is why news sites and other good sites with an email option do not use the mailto protocol.Fortunately, learning how to set up a simple mail program on your server is pretty easy, and there are plenty of tutorials to help you. W3Schools has one for PHP.

Share this post


Link to post
Share on other sites

I think the mailto protocol accepts some default variables for the subject and some fields but I don't even know how well supported that is.Nobody actually uses the mailto protocol for forms, just for e-mail links if at all.It's really old and has many drawbacks. Often the user doesn't want their e-mail client to open or they don't have it configured.

Share this post


Link to post
Share on other sites
<div class="files"><p>Contact</p> <?phpfunction spamcheck($field)   {   //filter_var() sanitizes the e-mail   //address using FILTER_SANITIZE_EMAIL   $field=filter_var($field, FILTER_SANITIZE_EMAIL);   //filter_var() validates the e-mail   //address using FILTER_VALIDATE_EMAIL   if(filter_var($field, FILTER_VALIDATE_EMAIL))     {     return TRUE;     }   else     {     return FALSE;     }   } if (isset($_REQUEST['email']))   {//if "email" is filled out, proceed   //check if the email address is invalid   $mailcheck = spamcheck($_REQUEST['email']);   if ($mailcheck==FALSE)     {     echo "Invalid input";     }   else     {//send email     $email = $_REQUEST['email'] ;     $subject = $_REQUEST['subject'] ;     $message = $_REQUEST['message'] ;     mail("caitlin-havener@hotmail.com", "Mail from Havener.me: $subject",     $message, "From: $email" );     echo "Thank you for using our mail form. Go <a href='http://havener.me'>back.</a>";     }   } else   {//if "email" is not filled out, display the form   echo "<form method='post' action='contact.php'>   Your Email: <input name='email' type='text' /><br />   Subject: <input name='subject' type='text' /><br />   Message:<br />   <textarea name='message' rows='15' cols='40'>   </textarea><br />   <input type='submit' />   </form> <br />   Go <a href='http://havener.me'>back.</a>";   }  ?> </div>

Any way I can make sure this doesn't go to my junk folder?

Share this post


Link to post
Share on other sites

On the server-side, no, but you can try to make it look more authentic in an attempt to reduce the likelihood of it going into the spam folder - for example, by making the domain of the From: email address identical to the domain the email is being sent from (that's probably the primary factor). After all, wouldn't you find it suspicious if an email claiming to be from (e.g.) me@a.com arrived from the mail server at b.com?On the client side, you can just add the sender's email address to your address book - that usually makes the client identify the mail as legitimate.Of course, both these measures are not possible if you are using the email address entered on the form as the From: address. One way to get around this is to put that address in the Reply-To: field instead (so you send an email to it if you hit "reply"), and put an email address from your site's domain in the From: field. This will probably increase the spam score a bit again, but better than nothing I suppose.Also, don't forget to put line breaks - \r\n - after each header field.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...