0
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: [email protected]
password: pass
这是用于swift邮件程序的配置。自动在Symfony中为SwiftMailer设置默认值FROM
array('[email protected]' => 'user'),
:如果我想发送电子邮件的话,我必须使用:
$message = $this->getMailer()->compose(
array('[email protected]' => 'user'),
$affiliate->getEmail(),
'Jobeet affiliate token',
body
);
$this->getMailer()->send($message);
我想设置这条线。如果我在配置中更改[email protected],那么我想在这一行中自动更改。我在我的网站的少数地方有邮件。 可能吗?
也许与app.yml中的相同?
感谢您的帮助
我知道,但在设置这个行不通.yml –
我想,该邮件应该在factories.yml中配置。如果你在settings.yml中配置了邮件程序,可以试试'(sfConfig :: get(“settings_mailer_transport_param_username”)' – denys281