Guest User

Untitled

a guest
Jan 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. use ZendMailTransportSmtp as SmtpTransport;
  2. use ZendMailTransportSmtpOptions;
  3. use ZendMail;
  4. use ZendMailMessage;
  5.  
  6. $message = new Message();
  7. $message->addTo('test@hotmail.com')
  8. ->addFrom('test@host.nl')
  9. ->setSubject('Greetings and Salutations!')
  10. ->setBody("Sorry, I'm going to be late today!");
  11.  
  12. // Setup SMTP transport using LOGIN authentication
  13. $transport = new SmtpTransport();
  14. $options = new SmtpOptions(array(
  15. 'name' => 'smtphost',
  16. 'host' => 'smtphost',
  17. 'port' => 465,
  18. 'connection_class' => 'login',
  19. 'connection_config' => array(
  20. 'username' => 'test@host.nl',
  21. 'password' => 'password',
  22. 'ssl' => 'ssl',
  23. ),
  24. ));
  25. $transport->setOptions($options);
  26. $transport->send($message);
Add Comment
Please, Sign In to add comment