Swiftmailer 成功发送但未收到邮件 [英] Swiftmailer successfully sends but no mail received

查看:27
本文介绍了Swiftmailer 成功发送但未收到邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个简单的联系表格,并使用 swiftmailer(使用 symfony2)发送和发送电子邮件.

I have made a simple contact form and use swiftmailer(with symfony2) to send and email.

当我使用 gmail 帐户时一切正常,但在生产中它必须是网站域中的 noreply 地址.所以我更改了参数以对应这个电子邮件帐户.

Everything is fine when I'm using gmail account but on production it has to be a noreply address in website domain. So I changed parameters to correspond this email account.

看起来它正在工作,一个发送方法返回 true 但没有收到任何消息,我检查了一个垃圾邮件文件夹,但它也没有到达那里.设置是 100% 正确的,因为它们在 Thunderbird 中工作.

It looks like it is working a send method return true but no message is received, i checked a spam folder but it didn't get there either. Settings are 100% correct as they work in thunderbird.

不知道去哪里寻找问题.有什么建议我应该检查什么?

Have no idea where to look for a problem. Any suggestions what should I check?

我曾尝试使用相同的帐户使用 PHPMailer 发送电子邮件,并且成功了,因此似乎问题仅在于 swiftmailer.我正在我的项目中的其他几个地方发送电子邮件,并希望现在避免更改它,而是修复它.

I have tried to send email with PHPMailer using same account and it worked so it seems problem is just with swiftmailer. I'm sending emails in few more places in my project and would like to avoid changing it now but fix it instead.

推荐答案

查看日志后发现问题.

电子邮件被拒绝,因为我将发件人"设置为用户提供的电子邮件.服务器拒绝他们,因为此地址不属于我发送的帐户.

Emails were rejected because I was setting From filed to email provided by user. Server was rejecting them because this address don't belong to account I was sending from.

这篇关于Swiftmailer 成功发送但未收到邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆