Thursday, May 27, 2010

Symfony: Mailer

In action

$message = $this->getMailer()->compose(
    array('your@email.com'=>'Your Name'),
    'otheremail@email.com',
    'Subject',
    'Body'
);
$this->getMailer()->send($message);


factories.yml

dev:
  mailer:
     class: sfMailer
     param:
       logging:           %SF_LOGGING_ENABLED%
       charset:           %SF_CHARSET%
       delivery_strategy: realtime
       transport:
         class: Swift_SmtpTransport
         param:
           host:       localhost
           port:       25
           encryption: ~
           username:   ~
           password:   ~

No comments:

Post a Comment