Guest User

Untitled

a guest
Aug 26th, 2018
1,486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. $email = 'myemail@gmail.com';
  2. $password = '4aea798c-4670-4ba9a4ecce00';
  3. $to_id = 'contact@myemail.com';
  4. $message = 'hello';
  5. $subject = 'hello@12';
  6.  
  7.  
  8. $mail = new PHPMailer;
  9. $mail->isSMTP();
  10. $mail->Host = 'smtp25.elasticemail.com';
  11. $mail->Port = 25;
  12. $mail->SMTPSecure = 'tls';
  13. $mail->SMTPAuth = true;
  14. $mail->Username = $email;
  15. $mail->Password = $password;
  16.  
  17. // Email Sending Details
  18. $mail->addAddress($to_id);
  19. $mail->Subject = $subject;
  20. $mail->msgHTML($message);
  21.  
  22. // Success or Failure
  23. if (!$mail->send()) {
  24. $error = "Mailer Error: " . $mail->ErrorInfo;
  25. echo '<p id="para">'.$error.'</p>';
  26. }
  27. else {
  28. echo '<p id="para">Message sent!</p>';
  29. }
  30.  
  31.  
  32. ?>
Add Comment
Please, Sign In to add comment