Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2017
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. $mail->isSMTP(); // Set mailer to use SMTP
  2. $mail->SMTPAuth = true; // Enable SMTP authentication
  3. $mail->Username = 'xx@gmail.com'; // SMTP username
  4. $mail->Password = 'xxxx'; // SMTP password
  5. $mail->Host = 'smtp.gmail.com';
  6. $mail->SMTPSecure = 'ssl';
  7. $mail->Port = 465;
  8.  
  9. //Set the encryption system to use - ssl (deprecated) or tls
  10. $mail->setFrom('info@example.com', 'CodexWorld');
  11. $mail->addReplyTo('info@example.com', 'CodexWorld');
  12. $mail->addAddress('john@gmail.com'); // Add a recipient
  13. $mail->addAddress($data['email']); // Add a recipient
  14. $mail->isHTML(true); // Set email format to HTML
  15.  
  16. $message = '
  17.  
  18. <p>HELLO</p>
  19.  
  20.  
  21.  
  22.  
  23. ';
  24.  
  25. $mail->msgHTML($message);
  26.  
  27. try {
  28. if(!$mail->send())
  29. {
  30. echo $mail->ErrorInfo;
  31. }else{
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement