[英]SocketError (getaddrinfo: nodename nor servname provided, or not known): Rails Mailer
My action mailer configuratin is:我的动作邮件配置是:
config.action_mailer.perform_caching = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.mycustumdomail.com',
port: 587,
domain: 'mycustomdomain.com',
user_name: 'memories@mycustomdomain.com',
password: 'mypassword',
authentication: 'plain',
enable_starttls_auto: true
}
For the above configuration I am getting following error:对于上述配置,我收到以下错误:
[ActiveJob] [ActionMailer::DeliveryJob] [14a369d5-5a2c-44fd-bb4b-2c5a5edf90a6] Error performing ActionMailer::DeliveryJob (Job ID: 14a369d5-5a2c-44fd-bb4b-2c5a5edf90a6) from Async(mailers) in 78.46ms: SocketError (getaddrinfo: nodename nor servname provided, or not known): [ActiveJob] [ActionMailer::DeliveryJob] [14a369d5-5a2c-44fd-bb4b-2c5a5edf90a6] 在 78.46ms 中从异步(邮件程序)执行 ActionMailer::DeliveryJob(作业 ID:14a369d5-5a2c-44fd-bb4b-2c5a5edf90a6)时出错:SocketError (getaddrinfo:提供节点名或服务名,或未知):
I have purchased the domain from Godaddy.我从 Godaddy 购买了域名。 And configure its mail to gmail gsuite.并将其邮件配置为gmail gsuite。
I had a same problem, and solved it by change the smtp settings.我有同样的问题,并通过更改 smtp 设置解决了它。
Thank you zakariah1!谢谢zakariah1!
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
...
}
This is from the Rails docs.这是来自 Rails 文档。 https://guides.rubyonrails.org/action_mailer_basics.html https://guides.rubyonrails.org/action_mailer_basics.html
This is from the Rails docs for setting up gmail.这是来自用于设置 gmail 的 Rails 文档。
https://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration-for-gmail https://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration-for-gmail
Should your address be the following?你的地址应该是以下吗? :address => 'smtp.gmail.com', :address => 'smtp.gmail.com',
config.action_mailer.default_url_options = { host: 'example.com' }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.