Guest User

Untitled

a guest
Jul 17th, 2018
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. sendmail_path = /usr/sbin/sendmail -t -i
  2.  
  3. /etc/init.d/postfix status
  4.  
  5. <?php $to = 'GMAIL_EMAIL@gmail.com';
  6. $subject = 'Testing';
  7. $message = 'Hello';
  8. $headers = 'From: GMAIL_EMAIL@gmail.com' . "rn" .
  9. 'Reply-To: GMAIL_EMAIL@gmail.com' . "rn" .
  10. 'X-Mailer: PHP/' . phpversion();
  11.  
  12. mail($to, $subject, $message, $headers);
  13. ?>
  14.  
  15. yum install cyrus-sasl-plain
  16.  
  17. <?php
  18. require_once 'swift/lib/swift_required.php';
  19.  
  20. $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
  21. ->setUsername('GMAIL_USERNAME')
  22. ->setPassword('GMAIL_PASSWORD');
  23.  
  24. $mailer = Swift_Mailer::newInstance($transport);
  25.  
  26. $message = Swift_Message::newInstance('Example Subject')
  27. ->setFrom(array('some@some-mail.com' => 'Example'))
  28. ->setTo(array('abc@another-mail.com'))
  29. ->setBody('This is an Example Mail.');
  30.  
  31. $result = $mailer->send($message);
  32. ?>
Add Comment
Please, Sign In to add comment