Guest User

Untitled

a guest
Feb 18th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. define('PHPMAILERHOST', 'smtp.sparkpostmail.com');
  2. $phpmailer_smtpuser = 'SMTP_Injection';
  3. $phpmailer_smtppassword = '<API_KEY>';
  4. define('PHPMAILERPORT', 587);
  5.  
  6. $config['mailtype'] = "html";
  7. $config['protocol'] = 'smtp';
  8. $config['smtp_host'] = 'smtp.sparkpostmail.com';
  9. $config['smtp_user'] = 'user';
  10. $config['smtp_pass'] = 'password';
  11. $config['smtp_crypto'] = 'tls';
  12. $config['smtp_port'] = '587';
  13. $condig['crlf'] = "rn";
  14. $config['newline'] = "rn";
  15.  
  16. //Sparkpost configuration
  17. $config['mailtype'] = "html";
  18. $config['protocol'] = 'smtp';
  19. $config['smtp_host'] = 'smtp.sparkpostmail.com';
  20. $config['smtp_user'] = 'user';
  21. $config['smtp_pass'] = 'password';
  22. $config['smtp_crypto'] = 'tls';
  23. $config['smtp_port'] = '587';
  24. $condig['crlf'] = "rn";
  25. $config['newline'] = "rn";
  26.  
  27. //My email code
  28. $to_email = "$Email";
  29. $from_email = "me@mydomain";
  30. $subject = "Email Subject";
  31. $comment = "<html>Email message</html>";
  32.  
  33. // Always set content-type when sending HTML email
  34. $headers = "MIME-Version: 1.0" . "rn";
  35. $headers .= "Content-type:text/html;charset=UTF-8" . "rn";
  36.  
  37. // More headers
  38. $headers .= "From: Info <" . $from_email . ">rn";
  39. //send email
  40. mail($to_email, "$subject", $comment, $headers);
  41.  
  42. $mail = new PHPMailer;
  43. $mail->SMTPDebug = 3;
  44. $mail->isSMTP();
  45. $mail->Host = 'smtp.sparkpostmail.com';
  46. $mail->Port = 587;
  47. $mail->SMTPSecure = 'tls';
  48. $mail->SMTPAuth = true;
  49. $mail->Username = 'SMTP_Injection';
  50. $mail->Password = '<API_KEY>'; //make sure you add SMTP permission to API Key
  51. $mail->setFrom('testing@sparkpostbox.com'); //you can use w/o adding your sending domain like ~50 messages. Once you add your sending domain, use that.
  52. $mail->addAddress('recipient@domain.com');
  53. $mail->Subject = 'Test subject';
  54. $mail->Body = 'Hello World!';
  55. $mail->send();
Add Comment
Please, Sign In to add comment