Jump to content

Mailing a PHP Form


inquisitive

Recommended Posts

Anyone see anything wrong with this php mailer code? It is in my form processing document after I declare the variables but before I insert them into the query. so the structure looks like this if you will

 

Declare variables

mailer

Insert into database query

 

$to = "[email protected]";

$from = "[email protected]";

$subject = "Newletter Rerquest from - ".$_SERVER['HTTP_HOST']." by " .$form1." " .$form2;

$message = "Company Name: " .$form1 ."<br>" ."Address: " .$form2 ."<br>" ."City: " .$form3 ."<br>" ."State: " .$form4 ."<br>" ."Zip: " .$form5 ."<br>Sales Manager Email: " .$form6 ."<br>Production Manager Email: " .$form7 ."<br>Office Manager Email: " .$form8 ."<br>Service Manager Email: " .$form9 ."<br>Phone: " .$form10 ."<br>Fax: " .$form11 ."<br>Questions: " .$form12;

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= "From: $from";

mail($to,$subject,$message,$headers);

Link to comment
https://forums.phpfreaks.com/topic/122892-mailing-a-php-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.