553 5.7.1 <mydomain>:发件人地址被拒绝:不属于用户 admin@mydomain.com [英] 553 5.7.1 <mydomain>: Sender address rejected: not owned by user admin@mydomain.com
问题描述
在 rails4 应用程序中,我尝试通过配置 smtp 设置来发送电子邮件,但出现以下错误:
In a rails4 application, I am trying to send emails by configuring smtp settings but I am getting the following error:
553 5.7.1 : 发件人地址被拒绝:不归用户所有admin@mydomain.com
553 5.7.1 : Sender address rejected: not owned by user admin@mydomain.com
我正在使用以下设置:
config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.mydomain.com",
:port => 25,
:domain => "mydomain.com",
:user_name => "admin@mydomain.com",
:password => "CorrectPassword",
:authentication => :plain,
:enable_starttls_auto => true,
:openssl_verify_mode => 'none'
}
config.action_mailer.default_url_options = {:host => "mydomain.com"}
当我使用我的 gmail 帐户设置时,同样有效.我从 bigrock.com 获得了我的域,并且所有 MX 记录都经过验证.我可以手动发送电子邮件(通过登录 webmail.mydomain.com).这个问题使我的网站的发布延迟了好几天.请帮忙!
The same works when I use my gmail account settings. I got my domain from bigrock.com and all MX Records are verified. I am able to send emails manually (by logging in webmail.mydomain.com). This issue has delayed the release of my site by quite a few days. Please Help!
推荐答案
正如@marc-b 评论的那样,
As @marc-b commented,
邮件服务器拒绝您的电子邮件,因为您尝试使用与您登录的用户名不同的用户名发送邮件,例如您已将 From: 设置为 no-reply@mydomain.com
,这显然与 admin@mydomain.com
The mail server is rejecting your email because you're trying to send from a username which differs from the username you're logging in as, e.g. you've set the From: to be
no-reply@mydomain.com
, which is obviously not the same asadmin@mydomain.com
解决方案是:
...你是对的....我将from"字段的值更改为与 user_name 相同.
.. You are right. ... I changed the "from" field's value to same as user_name.
这篇关于553 5.7.1 <mydomain>:发件人地址被拒绝:不属于用户 admin@mydomain.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!