Jump to content

Need help with HTML FORM email


razeldazel2

Recommended Posts

so, what i am trying to do is send an email from an HTML FORM. i want to keep it somewhat simple, meaning i don't want employ JS or PHP. HTML and CSS only.
what i have so far:
<form name="DriveOnRequest" method="POST" action="mailto:myemail@example.com?subject=Drive On Request" type="text/html" content-type="Multipart/formdata" accept-charset="UTF-8" enctype="Multipart/formdata" >     <table>        <td>            <tr>                <th><label>Requestor Name:<abbr title="Enter your name if you are the requestor or the name of the person who you are requesting the drive on for.">Help</abbr></label></th>                <td><label>First</label><input type="text" name="first1" min="2" required></td>                <td><label>Last</label><input type="text" name="last1" min="2" required></td>            </tr>
this is the more important part .. i think as i believe that the problem is somewhere in here.
i am closing the form out and have a submit button. everything works fine up until then.
when i submit it opens the default email program and is ready to send; however, the email inside looks something like this:

 

first1=Test&last1=Test
Questions:
1. How can i remove the INPUT NAME Tags (first1=) or at least the "=" sign?
2. How can i remove the "&" sign obviously used as space.
3. Is there a way to style the whole thing at all? Because this is really where i need it. In the email, not the form.
I am thinking that it has to do with the charset or the encoding but i am not sure. I find everything on the www about how to style the form but no more than bits and pieces about the resulting email.
Link to comment
Share on other sites

E-mail clients only take a subject variable. The rest of the variables are handled however the e-mail client wants to, and you have no control over it. The mailto: protocol is really limited and not very user friendly.

 

If you want full control over mail you have to use a server-side language, such as PHP, to process the form data and send the mail. W3Schools has a simple PHP mail tutorial: http://www.w3schools.com/php/php_mail.asp

Link to comment
Share on other sites

 

i saw that, been looking at it a few times actually but this output:

 

name=your name

mail=your emailcomment=your comment

 

 

is exactly what i am trying to avoid. i want to cut out the "name=" and just have "Your Name" etc. if there is no way to style it i probably could life with that but this would be the bare minimum.

Link to comment
Share on other sites

E-mail clients only take a subject variable. The rest of the variables are handled however the e-mail client wants to, and you have no control over it. The mailto: protocol is really limited and not very user friendly.

 

If you want full control over mail you have to use a server-side language, such as PHP, to process the form data and send the mail. W3Schools has a simple PHP mail tutorial: http://www.w3schools.com/php/php_mail.asp

 

so no way around PHP. i have been looking at this as well but it doesn't specifically mention that i have to have PHP installed. does that mean that I don't have to?

reason i am asking is because this is going to run on a network that i have very little influence of. i won't be able to install PHP in short. will this still work?

Link to comment
Share on other sites

No, it won't work if PHP isn't installed on the server. The best thing to do is to tell the user to put their data in the body rather than trying to use form fields to put it there.

Link to comment
Share on other sites

I guess I don't know what you are hoping to achieve. The HTML-only approach is totally dependent on the user having a pop-email client properly set up on their computer, but it could be that all pop-email clients do not handle it the same way. For example if you know your users will all have Microsoft Outlook then you might have to search for the Microsoft Outlook documentation.

 

http://msdn.microsoft.com/en-us/library/aa767737%28v=vs.85%29.aspx

Link to comment
Share on other sites

I guess I don't know what you are hoping to achieve. The HTML-only approach is totally dependent on the user having a pop-email client properly set up on their computer, but it could be that all pop-email clients do not handle it the same way. For example if you know your users will all have Microsoft Outlook then you might have to search for the Microsoft Outlook documentation.

 

http://msdn.microsoft.com/en-us/library/aa767737%28v=vs.85%29.aspx

i guess i could be ok if i could figure out how to not display the "name=" and rather simply have what was imputed show on it's own. the problem is the way it stand now whatever name i give the INPUT will be used as the label in the email body. that's no good. if i leave the "name=" out of the INPUT element then it won't submit at all. in short, the email link is fine, the resulting content in the email body is not.

 

No, it won't work if PHP isn't installed on the server. The best thing to do is to tell the user to put their data in the body rather than trying to use form fields to put it there.

i am the one eyed leading the blind here. i could tell them but not only can they not see but they also do not listen. that's why i am making this form. the form does not leave room for chatter, all fields are required with a minimum of 2 characters. i don't want to figure things out for themselves because if they do, they will and they will go overboard and add all kinds of info i don't need.

what about JS? could that work?

Link to comment
Share on other sites

Thanks, looks very much like what i am trying to achieve is not possible with HTML alone

I would use PHP if i were you in this situation, it has more flexibility and you could use HTML mail, to style the email, using values from the PHP form.

 

Let me know if you need examples of code for your solution. I'll be sure to help.

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...