• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Need help with HTML FORM email

Bot

Joined
Apr 14, 2009
Messages
594 (0.10/day)
System Name BoTBlue
Processor Intel i7-3770
Motherboard Intel DQ77MK
Cooling Corsair H80
Memory Samsung 4x4Gb
Video Card(s) ASUS GTX 470
Storage OCZ Vertex LE
Display(s) Acer
Case AthenaTech
Power Supply Corsair 850w
Software Win 7 Pro x64
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:
HTML:
<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.
 

Easy Rhino

Linux Advocate
Staff member
Joined
Nov 13, 2006
Messages
15,576 (2.37/day)
Location
Mid-Atlantic
System Name Desktop
Processor i5 13600KF
Motherboard AsRock B760M Steel Legend Wifi
Cooling Noctua NH-U9S
Memory 4x 16 Gb Gskill S5 DDR5 @6000
Video Card(s) Gigabyte Gaming OC 6750 XT 12GB
Storage WD_BLACK 4TB SN850x
Display(s) Gigabye M32U
Case Corsair Carbide 400C
Audio Device(s) On Board
Power Supply EVGA Supernova 650 P2
Mouse MX Master 3s
Keyboard Logitech G915 Wireless Clicky
Software The Matrix
Did you figure this out because I don't understand what you are doing? You see first1=Test&last1=Test because you are passing those values to the email program. However the email client does not know what to do with them. Your form method is POST but an email client cannot accept POST at least as far as I know. This is why you pass those values to PHP or Javascript and then have THAT process the values and send an email using the internal mail server...
 
  • Like
Reactions: Bot
Joined
Mar 6, 2014
Messages
45 (0.01/day)
System Name Cooler GTX660
Processor Intel Core i5 3570K
Motherboard Asus P8Z77-V PRO
Cooling Aero Cool
Memory Cosair 8GB Vengance 1600MHz
Video Card(s) Nvidia GTX660
Storage 1TB 2x500GB RAID 0
Display(s) 26 inch Samsung 1920 x 1200
Case Cooler Master
Audio Device(s) Onbord Realtek
Software Windows 8.0 64Bit
You are going to need JS and PHP cause HTML and CSS cannot process an email alone.
 

Easy Rhino

Linux Advocate
Staff member
Joined
Nov 13, 2006
Messages
15,576 (2.37/day)
Location
Mid-Atlantic
System Name Desktop
Processor i5 13600KF
Motherboard AsRock B760M Steel Legend Wifi
Cooling Noctua NH-U9S
Memory 4x 16 Gb Gskill S5 DDR5 @6000
Video Card(s) Gigabyte Gaming OC 6750 XT 12GB
Storage WD_BLACK 4TB SN850x
Display(s) Gigabye M32U
Case Corsair Carbide 400C
Audio Device(s) On Board
Power Supply EVGA Supernova 650 P2
Mouse MX Master 3s
Keyboard Logitech G915 Wireless Clicky
Software The Matrix

Bot

Joined
Apr 14, 2009
Messages
594 (0.10/day)
System Name BoTBlue
Processor Intel i7-3770
Motherboard Intel DQ77MK
Cooling Corsair H80
Memory Samsung 4x4Gb
Video Card(s) ASUS GTX 470
Storage OCZ Vertex LE
Display(s) Acer
Case AthenaTech
Power Supply Corsair 850w
Software Win 7 Pro x64
yes thanks @rhino. i thought HTML and CSS could do it or figure it should be able to do it. it's not, at least not in the way i imagined and wanted it.
i created a form which looked nice with INPUT fields and requirements and so forth and basically wanted the resulting email to look similar or the same but instead have the INPUT fields show in the email just show the information that was submitted. basically in the INPUT name field the actual name would show that was submitted.
doesn't work that way. i could have done without all the styling but the result still showed the name tag of the input string, which made the email very hard to read and confusing.

so PHP would be the best option. However, in my rare case, this was not supposed to be part of a website. this was supposed to be more of an outlook template replacement. we have a small group of people here (10-12) that sends us visitor requests for people to come to our work site that are not employees. everytime they send us these requests the email looks different and they do crazy stuff with the information we need to get out of those emails. we tried talking to them but it's no use so i decided to make a template. initially in outlook which worked well but not everybody has or uses outlook. so i needed another way to get them to use a form of some sort which led me to HTML. thought i just create a single html file, no website and let them use it to submit their requests. so obviously since this is going to be running on their personal whatever machine i won't have any influence on what OS or other programs are installed nor can i require them to install them which is exactly why i choose HTML. it would run on any machine, regardless of the environment and programs installed.

didn't work out so i am still in a pickle to figure this out
 

Easy Rhino

Linux Advocate
Staff member
Joined
Nov 13, 2006
Messages
15,576 (2.37/day)
Location
Mid-Atlantic
System Name Desktop
Processor i5 13600KF
Motherboard AsRock B760M Steel Legend Wifi
Cooling Noctua NH-U9S
Memory 4x 16 Gb Gskill S5 DDR5 @6000
Video Card(s) Gigabyte Gaming OC 6750 XT 12GB
Storage WD_BLACK 4TB SN850x
Display(s) Gigabye M32U
Case Corsair Carbide 400C
Audio Device(s) On Board
Power Supply EVGA Supernova 650 P2
Mouse MX Master 3s
Keyboard Logitech G915 Wireless Clicky
Software The Matrix
yes thanks @rhino. i thought HTML and CSS could do it or figure it should be able to do it. it's not, at least not in the way i imagined and wanted it.
i created a form which looked nice with INPUT fields and requirements and so forth and basically wanted the resulting email to look similar or the same but instead have the INPUT fields show in the email just show the information that was submitted. basically in the INPUT name field the actual name would show that was submitted.
doesn't work that way. i could have done without all the styling but the result still showed the name tag of the input string, which made the email very hard to read and confusing.

so PHP would be the best option. However, in my rare case, this was not supposed to be part of a website. this was supposed to be more of an outlook template replacement. we have a small group of people here (10-12) that sends us visitor requests for people to come to our work site that are not employees. everytime they send us these requests the email looks different and they do crazy stuff with the information we need to get out of those emails. we tried talking to them but it's no use so i decided to make a template. initially in outlook which worked well but not everybody has or uses outlook. so i needed another way to get them to use a form of some sort which led me to HTML. thought i just create a single html file, no website and let them use it to submit their requests. so obviously since this is going to be running on their personal whatever machine i won't have any influence on what OS or other programs are installed nor can i require them to install them which is exactly why i choose HTML. it would run on any machine, regardless of the environment and programs installed.

didn't work out so i am still in a pickle to figure this out

Write a basic PHP form page on your server and tell them to use it. They fill out the form, click submit, and it sends the person managing the process an email with the information. You can also setup a very simple backend to store the data.
 

Bot

Joined
Apr 14, 2009
Messages
594 (0.10/day)
System Name BoTBlue
Processor Intel i7-3770
Motherboard Intel DQ77MK
Cooling Corsair H80
Memory Samsung 4x4Gb
Video Card(s) ASUS GTX 470
Storage OCZ Vertex LE
Display(s) Acer
Case AthenaTech
Power Supply Corsair 850w
Software Win 7 Pro x64
yea, i was thinking more along the lines of a php file along with the html file but i think that won't work either. corp IT is kind of finicky about installing php on the server here. i explained that it is not rocket science but they believe it is evil =D
 
Top