Why SwiftMailer give no error message while failed?
Posted: Thu Feb 25, 2010 10:56 pm
I'm using SwifthMailer4.0.6 on WindowsXp, and hMailServer 5.3 on local,
my code is below:
This works and I can receive the email.
But my problem is:
When hMailServer is shut down, above php show no message (just blank page, seems waiting for end?) instead of "send email: " or display detailed error info.
Why it doesn't show detail error?
my code is below:
Code: Select all
<?php
error_reporting(E_ALL);
require_once 'swift/lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('localhost', 25);
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Test Subject');
$message->setFrom(array('test1@lucas.com' => 'John Doe'))
->setTo(array('bible@lucas.com' => 'Display Name'))
->setBody('Here is the message itself.',
'text/plain'
);
$result = $mailer->send($message);
echo "send email:".$result;
?
But my problem is:
When hMailServer is shut down, above php show no message (just blank page, seems waiting for end?) instead of "send email: " or display detailed error info.
Why it doesn't show detail error?