一聚教程网:一个值得你收藏的教程网站

热门教程

php 利用phpmailer 在线发送邮件

时间:2022-07-02 10:31:11 编辑:袖梨 来源:一聚教程网

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 = "mailangel123@163.com";
 $mail->FromName = "人才自荐";
 $Subject =PostGet('tel',1);
 $jmail =PostGet('mail',1);
 $body =PostGet('bodys',1);
  $array ='zjj@oeoa.cn';
  
  $mail->AddReplyTo("mailangel123@163.com", "此邮箱无需回复!");
  $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

热门栏目