2015-10-20 17 views
0

我有問題,通過Swiftmailer發送郵件Swiftmailer不起作用

我的參數文件是:

parameters: 
    mailer_transport: smtp 
    mailer_host: mail.myweb.cz 
    mailer_user: [email protected] 
    mailer_password: pass 

如果我發送郵件,以解決與[email protected],郵件到達。但是,如果我發送郵件到另一個地址,例如[email protected],郵件不會到達。在服務器

SMTP設置:

server: smtp.myweb.cz 
port: 587 
security: STARTTLS 
auth method: Normal password 

在Thunderbird是寄託都OK,錯誤必須在swiftmailer配置。

感謝您的幫助


編輯:

在我的本地開發計算機它的工作原理與哈維爾Eguiluz解決,但我有督促服務器上的錯誤現在:

app.ERROR :刷新電子郵件隊列時發生異常:無法使用TLS加密進行連接。

但是,如果我嘗試從任何其他計算機通過telnet連接到服務器與STARTTLS,它的工作原理。

你有什麼想法嗎?


解決方法:

問題是自簽名的證書。我沒有在可信任的證書中。

+1

如果發送給任何myweb.cz郵件到達那麼這似乎不符合swiftmailer問題配置,我認爲它必須是一些SMTP配置,它不允許發送到外部電子郵件地址,可能與中繼配置相關 –

回答

4

在我的Gmail配置中,我還需要將swiftmailer encryption選項定義爲ssl

也許你應該將以下內容添加到你的配置?

parameters: 
    mailer_transport: smtp 
    mailer_host: mail.myweb.cz 
    mailer_port: 587 
    mailer_encryption: tls 
    mailer_user: [email protected] 
    mailer_password: pass 

,然後在app/config/config.yml文件中添加這些新的選項太多:

swiftmailer: 
    # ... 
    port: %mailer_port% 
    encryption: %mailer_encryption% 

參考:http://symfony.com/doc/current/reference/configuration/swiftmailer.html#encryption

+1

謝謝,這是問題! –

+0

在我的本地開發計算機上工作,但我在prod服務器上出現錯誤:app.ERROR:刷新電子郵件隊列時發生異常:無法使用TLS加密進行連接。怎麼了? :( –