ClemensKim - kyj909

Zend Framework 2 Mail 관련 샘플 본문

IT/JAVA & PHP

Zend Framework 2 Mail 관련 샘플

kyj909 2014. 7. 22. 08:59

Zend Framework 2 사용시 메일관련 샘플


http://framework.zend.com/manual/1.12/en/zend.mail.introduction.html


  1. $mail = new Zend_Mail();
  2. $mail->setBodyText('This is the text of the mail.');
  3. $mail->setFrom('somebody@example.com', 'Some Sender');
  4. $mail->addTo('somebody_else@example.com', 'Some Recipient');
  5. $mail->setSubject('TestSubject');
  6. $mail->send();

----------------------------------------------------------------------

  1. $mail = new Zend_Mail();
  2. $mail->setBodyText('This is the text of the mail.')
  3.     ->setFrom('somebody@example.com', 'Some Sender')
  4.     ->addTo('somebody_else@example.com', 'Some Recipient')
  5.     ->setSubject('TestSubject')
  6.     ->send();

---------------------------------------------------------------------

  1. $tr = new Zend_Mail_Transport_Sendmail('-freturn_to_me@example.com');
  2. Zend_Mail::setDefaultTransport($tr);
  3.  
  4. $mail = new Zend_Mail();
  5. $mail->setBodyText('This is the text of the mail.');
  6. $mail->setFrom('somebody@example.com', 'Some Sender');
  7. $mail->addTo('somebody_else@example.com', 'Some Recipient');
  8. $mail->setSubject('TestSubject');
  9. $mail->send();

---------------------------------------------------------------------

도서참조

Zend Framework2.0 by Example







Comments