Home > Backend Development > PHP Tutorial > PHPMailer sends email

PHPMailer sends email

WBOY
Release: 2016-07-25 08:45:24
Original
1172 people have browsed it
  1. require './class.phpmailer.php';
  2. $mail=new PHPMailer();
  3. $mail->ContentType="text/html";
  4. $mail->Encoding=" base64";
  5. $mail->IsSMTP();
  6. $mail->Host="smtp.163.com";
  7. $mail->SMTPAuth=true;
  8. $mail->Username="test@ 163.com";
  9. $mail->Password="123456";
  10. $mail->SetFrom("test@163.com","test");
  11. $content=<< This is a test email, please don’t pay too much attention!
  12. EMAIL;
  13. $mail->Subject="Email Test";
  14. $mail->AddAddress("test@qq.com","newMail ");
  15. $mail->Body=$content;
  16. if($mail->Send()){
  17. echo "Send successfully! ";
  18. }else{
  19. echo "Failed to send!" >ErrorInfo;
  20. }
Copy code

Send email, PHPMailer


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template