Trying PEAR mail working with backend PHP mail() [Answered]
Posted: 19. September 2012 17:53
Good afternoon. I can successfully send SMTP mail which is most important. I would like to know why it doesn't work using the PHP mail() function.
Let us limit the discussion to Win7/xampp1.8.0 although it seems to be the case with Vista/xampp1.7.7 too.
I have taken this PHP script from tuxradar. It is the most basic example. Just add FROM and TO email addresses and place in the document root.
You will get Strict Standards error messages but these are not fatal and cannot explain the script's failure to send.
Does this happen to you?
If so, why is this the case?
best wishes
georgefk
Let us limit the discussion to Win7/xampp1.8.0 although it seems to be the case with Vista/xampp1.7.7 too.
I have taken this PHP script from tuxradar. It is the most basic example. Just add FROM and TO email addresses and place in the document root.
- Code: Select all
<?php
include('Mail.php');
$mail = Mail::factory("mail");
$headers = array("From"=>"FROM_EMAIL_ADDRESS", "Subject"=>"Test Mail");
$body = "This is a test!";
$mail->send("TO_EMAIL_ADDRESS", $headers, $body);
?>
You will get Strict Standards error messages but these are not fatal and cannot explain the script's failure to send.
Does this happen to you?
If so, why is this the case?
best wishes
georgefk