This topic is locked

Problem sending email after record add

2/5/2009 4:29:31 PM
PHPRunner General questions
J
jerjenple author

I am having a problem sending email notification of record after adding. I have copy and pasted code found in the forum and that didn't work either. When adding a record there aren't any errors. Do I need to change something in php, apache, or windows 2k3 to allow this to work?

Sergey Kornilov admin 2/5/2009

What code do you use?

J
jerjenple author 2/6/2009

What code do you use?


// ** Send conformation email ****
// variables

$to = "jeremy@mydomain.com";

$from = "Info <info@mydomain.com>";
$subject=$values["ID"]." ".$values["ID"];

$message=$values["ID"];
//Headers

$headers = "To: $to" . "\r\n";

$headers = "From: $from" . "\r\n";

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

$headers = "Content-Type: text/html; charset=\"iso-8859-1" . "\r\n";
// Send the message
mail($to, $subject, $message, $headers);
I have also tried setting the mail server through ini_set as mentioned in one of the forums with no luck. Also tried removing two lines of code in dbcommon.php as mentioned in another forum. I have my smtp info filled out in php.ini as well. I have substituted my domain information in the code above with mydomain.com since this is public, but am using our real domain in my project coding. Our mail server also does not require authentication.

J
Jane 2/9/2009

Hi,
see my changes below:

//Headers

$headers = "To: $to" . "\r\n";

$headers.= "From: $from" . "\r\n";

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

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