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!!
- Yii 1.0 or above
- Extract the release file under
See 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 = 'email@example.com'; $mail->Password = 'yourpassword'; $mail->SetFrom('firstname.lastname@example.org', '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('email@example.com', 'John Doe'); $mail->Send();
Change Log ¶
January 22, 2010 ¶
- Initial release.
It works good!
but if use it as components you must edit it.
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 ?
Thanx a lot
It works for me. Thank you for the extension.
How is this better than just using the raw php file?
I can put phpmailer.php in my components folder and call $mail = new phpmailer();
why bother with the extension?
VIEW / THEME supports?
reply to prchakal
renderPartial() in your controller is simple~
Gmail Testing fail
I am using Gmail also, but I fail to send email. Below is the snippet
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.
Thank you for adding this as an extension. Works fantastic after tons of trouble with two other mailers.
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:
Smtp Error: Could Not Connect To Smtp Host
i am getting the error => Smtp Error: Could Not Connect To Smtp Host
can any one tell how to fix it thnx... :)
Thank you for the extension.
Doesn't work in console mode.
Have any idea why ? In web version everything is fine, but in console mode is not.
When I try to use $mailer->Send() it start thinking about a minute, after that script dies. It doesn't show me any errors or something else.
Thing is that the same code sends mail in web mode, but doesn't in console.(all params are the same at console and at web apps).
Here is my code:
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.