Forum Moderators: coopster
I would like to modify my php mail form script to send html formatted form data to the recipient.
I have read some posts about formatting form data into HTML format prior to mailing it in from a php script.
I would just like you response to make sure I have the basics down.
I already have a functioning rfq html form page posting form data to a separate php mail form script that in turn sends the form data as unformatted email to the recipient.
I'm concluding that all I have to do is the following...
1. copy/past the html form tag body into the php script
2. correct all form field variables
3. assign corrected form tag body to $mailmessage
4. change "text/plain" to "text/html" in the mail $header
So the html form page gets sumitted and php script gets executed. The php script picks up the form data and assigns them to the form body variables. The form body is then assigned to $mailmessage then execute the mail function.
or
should I combine the html form page with the php script so the form page and php script is in one php script file so that the display of the form page, data entry, submitting, formatting and sending of the data occurs in the php script.
Personally I'd combine it all in to one script because I like having it all there at once, but there's other [highly respected] members here that separate display from processing. I've not seen any security issues related to the combination, so as far as I know it's just a matter of personal preference.