php 利用phpmailer 在线发送邮件

作者:袖梨 2022-07-02

html代码


 
   
     
     
   
   
     
     
   
   
     
     
   
   
     
     
   
 
邮箱:
电话:
内容:
 


去down.111cn.net教程下载一个phpmailer源码教程

require("mail/class.phpmailer.php"); 
 
 $mail = new PHPMailer(); 
 $mail->IsSMTP();                                      // set mailer to use SMTP
 $mail->Host = "smtp.163.com";  // smtp1.example.com;smtp2.example.comspecify main and backup server
 $mail->SMTPAuth = true;     // turn on SMTP authentication
 $mail->Username = "mailangel123";  // SMTP username
 $mail->Password = "*******"; // SMTP password
 
 
 $mail->From = "[email protected]";
 $mail->FromName = "人才自荐";
 $Subject =PostGet('tel',1);
 $jmail =PostGet('mail',1);
 $body =PostGet('bodys',1);
  $array ='[email protected]';
  
  $mail->AddReplyTo("[email protected]", "此邮箱无需回复!");
  $mail->AddAddress($array,'您好!');
  $mail->WordWrap = 50;
  $mail->CharSet="GB2312";                                  // set word wrap to 50 characters
  //$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments
  //$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
  $mail->IsHTML(true);                                  // set email format to HTML
  
  $mail->Subject = $Subject;
  $mail->Body    = $body.'
'.$jmail;
  //$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
  
  if(!$mail->Send())
  {
     echo "Message could not be sent.

";
     echo "Mailer Error: " . $mail->ErrorInfo;
     $mail->ClearAddresses();  
     $mail->ClearAttachments();
    
  }
  else
  {
   echo "您好,你的信息己经发送到我们负责人信箱,请等候佳声。javascript教程:window.close();">点击

关闭";
  }

  
 
 /* echo ""; */

?>
// 本站原创转载注明来源www.111com.net

相关文章

精彩推荐