0

since my provider changes to PHP 5.4 it seems, that my with php generated mails doesn't want to be sended anymore.

are there any changes to php mail with 5.4?

in 5.3 my code works fine:

$mime->setHTMLBody($html);
$mime->setTxtBody($text);
$pro_hdrs = array(
         'Content-Type'                 => 'text/html; charset=iso-8859-1',
         'Content-Transfer-Encoding'    => '8bit\r\n',
         'Date'                         => $mydate,
         'From'                         => '"Test"<test@test.com>',
         'To'                           => $email,
         'Reply-To'                     => $reply,
         'Subject'                      => $mysubject,
);
$pro_params["host"]     = 'somehost.com';
$pro_params["auth"]     = TRUE;
$pro_params["username"] = 'someuser';
$pro_params["password"] = 'somepw';
$body = $mime->get();
$pro_hdrs = $mime->headers($pro_hdrs);
 $pro_mail =& Mail::factory('smtp', $pro_params);
 $pro_mail->send($email, $pro_hdrs, $body);

Hope, you can give some help!

Cheers, Tom

Tom
  • 59
  • 1
  • 2
  • 16
  • 1
    Maybe it would help, if you set error_repoting to E_ALL to see all error messages. next step would be to give us the information, which Mail class you use there? – Florian Oct 20 '14 at 09:11
  • 1
    What is `$mime`? Do you use PHPMailer? What is `$pro_mail`? What is the `Mail` class? – Boldewyn Oct 20 '14 at 09:12
  • Try removing the & from the Mail class – AdRock Oct 20 '14 at 09:14
  • the problem is, that the server log doesnt show any error there... I use php mail (mail.php, mime.php), it's a newsletter loop. I have copied the script 2 years ago and it worked fine to this day. $pro_mail doesnt means anything. removing the & doesnt have any effect – Tom Oct 20 '14 at 09:24

1 Answers1

0

Remove the & from the following line:

$pro_mail =& Mail::factory('smtp', $pro_params);

so it becomes:

$pro_mail = Mail::factory('smtp', $pro_params);

It is just deprecated. It is interesting that it did not raise an E_DEPRECATED error. If it is not your production environment you can enable those.

Borislav Sabev
  • 4,776
  • 1
  • 24
  • 30