質問

Is is possible to set more accounts for Mail in Laravel 4? If I'm right, for the Mail facade I can set only one SMTP account in app/config/mail.php file. But in my application I need to send emails from two different SMTP accounts. I’m rewriting it from Symfony framework and as Symfony uses plain Swiftmailer it is very easy to set separate account credentials for every action. How could I do the same in Laravel?

役に立ちましたか?

解決 2

This let's me change mail instantiation:

$transport = SmtpTransport::newInstance('smtp.gmail.com', 25);
$transport->setEncryption('tls');
$transport->setUsername('ladislav@gmail.com');
$transport->setPassword('xxxxxx');
$swift = new Swift_Mailer($transport);
Mail::setSwiftMailer($swift);

他のヒント

What do you need to change? If its just the address or name see here, you can change the swiftmailer properties with that command

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top