Symfony 1.4 Adds BCC Recipient for Email Program

I know that with swift directly you can create a Recipient_List and do → addBcc (). How would I do the same 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'));
+3
source share
2 answers

compose () returns a Swift_Message object, you can use the setBcc () or addBcc () methods in the same way as with the fast

+5
source

if you are using 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 he can send gmail emails ....

I think you can!

example: http://swiftmailer.org/docs/sending.html

0
source

Source: https://habr.com/ru/post/1738076/


All Articles