<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_61471"> <div class="blockcode"> <div id="code_fGg"><ol> <li> <li> <li>require './class.phpmailer.php';</li> <li> <li>$mail=new PHPMailer();</li> <li>$mail->ContentType="text/html";</li> <li>$mail->Encoding="base64";</li> <li>$mail->IsSMTP();</li> <li>$mail->Host="smtp.163.com";</li> <li>$mail->SMTPAuth=true;</li> <li>$mail->Username="test@163.com";</li> <li>$mail->Password="123456";</li> <li>$mail->SetFrom("test@163.com","test");</li> <li>$content=<<<EMAIL<li>这是一封测试的邮件,请不要做过多的关注!<li>EMAIL;<li>$mail->Subject="邮件测试";</li> <li>$mail->AddAddress("test@qq.com","newMail");</li> <li>$mail->Body=$content;</li> <li>if($mail->Send()){</li> <li> echo "发送成功!";</li> <li>}else{</li> <li> echo "发送失败!".$mail->ErrorInfo;</li> <li>}</li> <li> </ol></div> <em onclick="copycode($('code_fGg'));">复制代码</em> </div> <br> </td></tr></table> <div class="ptg mbm mtn"> 發送郵件, PHPMailer</div> <div id="comment_61471" class="cm"> </div> <div id="post_rate_div_61471"></div> <br><br>