This is basically updated wrapper of SwiftMailer which can be used as application component.
... 'mailer' => array( 'class' => 'ext.swiftMailer.SwiftMailer', // For SMTP 'mailer' => 'smtp', 'host'=>'localhost', 'From'=>'admin@localhost', 'username'=>'smptusername', 'password'=>'123456', // For sendmail: 'mailer'=>'sendmail', ), ...
Yii::app()->mailer->AddAddress($email); Yii::app()->mailer->Subject = "Let's do this!"; Yii::app()->mailer->MsgHTML("<a href='http://site.com'>test</a>"); Yii::app()->mailer->Send();
Please, take a look a SwiftMailer::Send() function
Total 6 comments
How can I use your extension with gmail ?
gmail use port 465 with ssl
Nice wrapper. I like it.
Guys, the main purpose of me writing this extension is because my app used available "mailer" extension which used PHPMailer, but I had problems with sending mail by SMTP via PHPmailer, so i did this extension that does not change the way my app sends emails:
But it changes how the mail gets sent. Available SwiftMailer extensions did not allow me just to change extension I use for "mailer" component -- they all suggest a lot (more then 1 byte is a lot) of code to alter in my controllers and other places - I did bot need that, I just needed to change the mailer itself, so I wrote this extension, and shared it here mainly because I believe I might be not the only one with the same issues.
Thank you, love and peace to all!
I am a big fan of the 'other' extension, but I appreciate that this is trying to be as lean as possible. I might switch to this one instead. :)
You can still use templates: Just render to a string, and pass it in. Easy as that.
I'd say it's different in a way of being different. The example code is all you need to send email. No templates, though no extra code to write. It is just a sender, it's not supposed to support templates.
In what way is this different from this extension? http://www.yiiframework.com/extension/mail/
Leave a comment
Please login to leave your comment.