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 9 comments
I am using Gmail also, but I fail to send email. Below is the snippet
Yii::import('application.extensions.phpmailer.JPhpMailer'); $mail = new JPhpMailer; $mail->IsSMTP(); $mail->Host = 'smpt.gmail.com'; $mail->SMTPAuth = true; $mail->SMTPSecure = true; $mail->Username = 'yourname@gmail.com'; $mail->Port = '465'; $mail->Password = 'yourpassword'; $mail->SetFrom('yourname@gmail.com', 'yourname'); $mail->Subject = 'PHPMailer Test Subject via GMail, basic with authentication'; $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; $mail->MsgHTML('
JUST A TEST!
'); $mail->AddAddress('john.doe@otherdomain.com', 'John Doe'); $mail->Send();
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.