yamcsha

Zend Mail

Jun 10th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. /*
  2.  Zend Email Sender
  3.  this would work with other SMTP providers, config may change
  4. */
  5.  
  6. $mailHost   = 'smtp.gmail.com';
  7. $mailConfig = array(
  8.                 'ssl'      => 'ssl',
  9.                 'port'     => 465,
  10.                 'auth'     => 'login', // this is fix
  11.                 'username' => '[email protected]',
  12.                 'password' => '********'
  13.             );
  14. $smtpTransport = new Zend_Mail_Transport_Smtp($mailHost, $mailConfig);
  15. Zend_Mail::setDefaultTransport($smtpTransport);
  16.  
  17. $mail = new Zend_Mail('UTF-8');
  18. $mail->setFrom    ('[email protected]', 'sender_name')
  19.      ->addTo      ('[email protected]')
  20.      ->setSubject ('my subject')
  21.      ->setBodyHtml('my message here text/html')
  22.      ->send();
Advertisement
Add Comment
Please, Sign In to add comment