symfony 1.4 adding a BCC recipient to mailer
I know w开发者_运维百科ith swift directly you can create a Recipient_List and do ->addBcc() . How would i do this same thing in the context of symfony 1.4
$message = $this->getMailer()->compose();
$message->setSubject(sfConfig::get('app_email_welcome_subject'));
$message->setTo($user->getUsername());
$message->setFrom(sfConfig::get('app_email_from'));
compose() return a Swift_Message object, you can use setBcc() or addBcc() methods as you would with swift
if you use symfony 1.4 .your code can set
$message = Swift_Message::newInstance();
$message->setSubject($subject);
$message->setFrom($from);
$message->setBody($body);
$transport = Swift_SmtpTransport::newInstance(sfConfig::get('app_email_host'), sfConfig::get('app_email_port'), 'ssl')
->setUsername(sfConfig::get('app_email_username'))
->setPassword(sfConfig::get('app_email_password'));
$mailer = Swift_Mailer::newInstance($transport);
when use it can send email use gmail....
i think you can!
example: http://swiftmailer.org/docs/sending.html
精彩评论