PHP email transport class featuring file attachments, SMTP servers, CCs, BCCs, HTML messages, word wrap, and more. Sends email via sendmail, PHP mail(), QMail, or with SMTP. New PHPMailer for PHP5 released!!
protected/extensionsSee the following code example:
Yii::import('application.extensions.phpmailer.JPhpMailer'); $mail = new JPhpMailer; $mail->IsSMTP(); $mail->Host = 'smpt.163.com'; $mail->SMTPAuth = true; $mail->Username = 'yourname@163.com'; $mail->Password = 'yourpassword'; $mail->SetFrom('yourname@163.com', 'yourname'); $mail->Subject = 'PHPMailer Test Subject via smtp, basic with authentication'; $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; $mail->MsgHTML('<h1>JUST A TEST!</h1>'); $mail->AddAddress('john.doe@otherdomain.com', 'John Doe'); $mail->Send();
Total 11 comments
Not sure if it already works for you, but if you want to connect to a google mail account you have to set up the host like this:
Thank you for adding this as an extension. Works fantastic after tons of trouble with two other mailers.
Thanks again.
Thanks for the simple extension.
I had a bit of problem with the Gmail SMTP connection, but eventually found that adding the following solved the problem.
When I click submit on the default contact page form, the flash message tells my the email has been sent. This happens on localhost and the live test server. I am not sure why the code is executing correctly but no emails are arriving. (And yes, the email addresses and passwords were all correct and valid :)
I have the following code in my controller, please take a look and tell me if I'm missing something.
Thanks
I am using Gmail also, but I fail to send email. Below is the snippet
renderPartial() in your controller is simple~
VIEW / THEME supports?
I can put phpmailer.php in my components folder and call $mail = new phpmailer();
why bother with the extension?
It works good!
but if use it as components you must edit it.
such as:
add init();
add reply-to email;
change the iso-8859-1 to utf-8 for subject is not show in chinese.
Suppose smtp require SSL auth, such smtp as smtm.gmail.com ?
What than ?
Works great! Thanx a lot
It works for me. Thank you for the extension.
Leave a comment
Please login to leave your comment.