Guest User

Untitled

a guest
Feb 21st, 2018
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $mail->isSMTP();
  2. $mail->Host = 'smtp.gmail.com';
  3. $mail->SMTPAuth = true;
  4. $mail->Username = 'GMAIL EMAIL ACCOUNT';
  5. $mail->Password = 'MY PASSWORD FOR GMAIL EMAIL ACCOUNT';
  6. $mail->SMTPSecure = 'tlc';
  7. $mail->Port = 587;
  8. $mail->SMTPDebug = 3;
  9. $mail->setFrom('EMAIL ADDRESS', 'EXAMPLE');
  10. $mail->addAddress('ADDRESS TO SEND', 'From contact form');
  11.  
  12. $mail->addCC('cc@example.com');
  13. $mail->addBCC('bcc@example.com');
  14.  
  15. $mail->Subject = 'Here is the subject';
  16. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  17. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  18.  
  19. if(!$mail->send()) {
  20. echo 'Message could not be sent.';
  21. echo 'Mailer Error: ' . $mail->ErrorInfo;
  22. } else {
  23. echo 'Message has been sent';
  24. }
Add Comment
Please, Sign In to add comment