emailing html form
Posted: Mon Apr 19, 2010 11:07 am
Hi,
I am new to php, having come from a C++ background. I am trying to do something that should be fairly simple but have been banging my head against the wall trying to get it to work and not finding the answer on any forums. I am hoping that someone will be able to help me so that i can continue and learn more php functionality.
I am building a program which is supposed to take user input from a html form, insert it into a letter and email it in html format. This is something you see all over the web already. For instance, the user inputs her name and email address in to the html form, and then receives a pretty html email to her address, with the header saying "Dear Whomever Youare".
Here is what I have done so far:
Right now the user fills out the form and clicks on the submit button.
The values are assigned to the php variables.
Another php script is called using include('english.php'); or whatever language was chosen. What is displayed on the screen looks perfect.
The following lines are used to send the email
ob_start();
$emailBody = ob_get_clean();
mail( $email, $emailSubject, $emailBody, $headers);
What the recipient gets is an email that contains the contents of the enlish.php file as code, not as formatted html.
Does anyone know how to do this seemingly simple task?
Thanks,
MJ
I am new to php, having come from a C++ background. I am trying to do something that should be fairly simple but have been banging my head against the wall trying to get it to work and not finding the answer on any forums. I am hoping that someone will be able to help me so that i can continue and learn more php functionality.
I am building a program which is supposed to take user input from a html form, insert it into a letter and email it in html format. This is something you see all over the web already. For instance, the user inputs her name and email address in to the html form, and then receives a pretty html email to her address, with the header saying "Dear Whomever Youare".
Here is what I have done so far:
Right now the user fills out the form and clicks on the submit button.
The values are assigned to the php variables.
Another php script is called using include('english.php'); or whatever language was chosen. What is displayed on the screen looks perfect.
The following lines are used to send the email
ob_start();
$emailBody = ob_get_clean();
mail( $email, $emailSubject, $emailBody, $headers);
What the recipient gets is an email that contains the contents of the enlish.php file as code, not as formatted html.
Does anyone know how to do this seemingly simple task?
Thanks,
MJ