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 : Sender address rejected: not owned by user [email protected]
I am using the following settings:
config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.mydomain.com",
:port => 25,
:domain => "mydomain.com",
:user_name => "[email protected]",
:password => "CorrectPassword",
:authentication => :plain,
:enable_starttls_auto => true,
:openssl_verify_mode => 'none'
}
config.action_mailer.default_url_options = {:host => "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!
As @marc-b commented,
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
[email protected]
, which is obviously not the same as[email protected]
And the solution was:
.. You are right. ... I changed the "from" field's value to same as user_name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With