hi everyone
I´m try send email with yiimail extension, it´s work fine, but if I set a SMTP with error, for example, a wrong password or username, the yii::app()->mail->send($message), return this error
<h1>PHP Error [8]</h1>
<p>Undefined property: Swift_Transport_StreamBuffer::$_sequence (/Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Transport/StreamBuffer.php:211)</p>
<pre>#0 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Transport/StreamBuffer.php(211): CWebApplication->handleError()
#1 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/ByteStream/AbstractFilterableInputStream.php(168): Swift_Transport_StreamBuffer->_commit()
#2 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/ByteStream/AbstractFilterableInputStream.php(84): Swift_Transport_StreamBuffer->_doWrite()
#3 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Transport/AbstractSmtpTransport.php(284): Swift_Transport_StreamBuffer->write()
#4 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Transport/EsmtpTransport.php(197): Swift_SmtpTransport->executeCommand()
#5 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Transport/EsmtpTransport.php(241): Swift_SmtpTransport->executeCommand()
#6 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Transport/AbstractSmtpTransport.php(108): Swift_SmtpTransport->_doHeloCommand()
#7 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/vendors/swiftMailer/classes/Swift/Mailer.php(74): Swift_SmtpTransport->start()
#8 /Library/WebServer/Documents/MBilling_3/protected/extensions/yii-mail/YiiMail.php(133): Swift_Mailer->send()
#9 /Library/WebServer/Documents/MBilling_3/protected/components/Mail.php(338): YiiMail->send()
#10 /Library/WebServer/Documents/MBilling_3/protected/controllers/TemplatemailController.php(95): Mail->send()
#11 /Library/WebServer/Documents/MBilling_3/yii/framework/web/actions/CInlineAction.php(49): TemplateMailController->actiontestMail()
#12 /Library/WebServer/Documents/MBilling_3/yii/framework/web/CController.php(308): CInlineAction->runWithParams()
#13 /Library/WebServer/Documents/MBilling_3/yii/framework/web/CController.php(286): TemplateMailController->runAction()
#14 /Library/WebServer/Documents/MBilling_3/yii/framework/web/CController.php(265): TemplateMailController->runActionWithFilters()
#15 /Library/WebServer/Documents/MBilling_3/yii/framework/web/CWebApplication.php(282): TemplateMailController->run()
#16 /Library/WebServer/Documents/MBilling_3/yii/framework/web/CWebApplication.php(141): CWebApplication->runController()
#17 /Library/WebServer/Documents/MBilling_3/yii/framework/base/CApplication.php(169): CWebApplication->processRequest()
#18 /Library/WebServer/Documents/MBilling_3/index.php(12): CWebApplication->run()
</pre>
my current code is
$message->subject = $this->title;
$message->setBody($this->message, 'text/html');
$message->from = $this->from_email;
$message->setTo($this->to_email);
try {
Yii::app()->mail->send($message);
echo 'sussess';
} catch (Exception $e) {
echo 'No send '. print_r($e,true);
}
I think the return should be the ‘No send ( ERROR DETAILS)’
if I insert @ before Yii::app()->mail->send($message), the return is "sussess" but the email is not send.