| <?php Include (' class/class.phpmailer.php '); $config = Array ( ' Host ' => ' smtp.163.com ', ' Port ' => ' 25 ', ' User ' => ' * * *, ' passwd ' => ' * * * *, ' From ' => ' juva_zz@163.com ', ' FromName ' => ' Zhengzhou ',
); $subject = ' This is a test mail '; $body = ' <table style= background: #dfdfdf ' ><tr><td> test content </TD></TR><TR><TD > This is Content </td></tr></table> '; $address = ' 379018082@qq.com '; $username = ' I '; $mail = new Phpmailer (); $mail->charset = ' gb2312 '; $mail->issmtp (); $mail->host = $config [' Host ']; $mail->port = $config [' Port ']; $mail->from = $config [' from ']; $mail->fromname = $config [' FromName ']; $mail->smtpauth = true; $mail->username = $config [' user ']; $mail->password = $config [' passwd ']; $mail->subject= $subject; $mail->altbody= "text/html"; $mail->msghtml ($body); $mail->addaddress ($address, $username); if (! $mail->send ()) { echo "Mail Error:". $mail->errorinfo; }else { echo "Congratulations on sending success!" "; } |