kaspm Posted May 3, 2006 Share Posted May 3, 2006 Hi, I have a multipage form I want to send to an email address. Do I have to use:mail($whatever && $nextfor all the fields or would there be an eaiser way to do it.Thanks Link to comment https://forums.phpfreaks.com/topic/9007-multipage-form/ Share on other sites More sharing options...
todd3834 Posted May 3, 2006 Share Posted May 3, 2006 [!--quoteo(post=371058:date=May 3 2006, 01:40 PM:name=kaspm)--][div class=\'quotetop\']QUOTE(kaspm @ May 3 2006, 01:40 PM) [snapback]371058[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hi, I have a multipage form I want to send to an email address. Do I have to use:mail($whatever && $nextfor all the fields or would there be an eaiser way to do it.Thanks[/quote]It really depends on how you want to format your message, here is an example of a way to send the mail:[code]//this will show whatever is entered in the fullname input on your form //<input type="text" name="fullname">$mail_body = "Name: " . $_REQUEST['fullname'] . "\n"; // "\n" sends it to the next line$mail_body .= "Email: " . $_REQUEST['email'] . "\n"; $mail_body .= "Message: " . $_REQUEST['message'];// ".=" is used for adding to the end of the string that already existsmail("[email protected]", "Your Subject", $mail_body);[/code]If you would like to use HTML in your message or you would like to modify the e-mail headers so that you can use CC, BCC, or other features. For more information about using the mail function and some better examples than the one i wrote above go straight to the comments on the online documentation. [a href=\"http://www.php.net/function.mail\" target=\"_blank\"]http://www.php.net/function.mail[/a] Link to comment https://forums.phpfreaks.com/topic/9007-multipage-form/#findComment-33118 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.