Guest User

Untitled

a guest
Nov 4th, 2017
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. add_action( 'phpmailer_init', 'my_phpmailer_example' );
  2. function my_phpmailer_example( $phpmailer ) {
  3. $phpmailer->isSMTP();
  4. //$phpmailer->Host = 'smtp.example.com';
  5. // $phpmailer->SMTPAuth = true; // Force it to use Username and Password to authenticate
  6. $phpmailer->Port = 25;
  7. // $phpmailer->Username = 'yourusername';
  8. // $phpmailer->Password = 'yourpassword';
  9.  
  10. // Additional settings…
  11. //$phpmailer->SMTPSecure = "tls"; // Choose SSL or TLS, if necessary for your server
  12. $phpmailer->setFrom( "fromemail@bla.com", "From Name" );
  13. $phpmailer->addAddress( "youremail@bla.com", "Your name" );
  14. $phpmailer->Subject = "Testing PHPMailer";
  15. $phpmailer->Body = "Hurray! nn Great.";
  16. if( !$phpmailer->send() ) {
  17. echo "Mailer Error: " . $phpmailer->ErrorInfo;
  18. } else {
  19. echo "Message sent!";
  20. }
  21.  
  22. }
Add Comment
Please, Sign In to add comment