我正试图在localhost中触发一个mailer,我可以让它与gmail一起工作,但不能与我自己的电子邮件一起工作,该邮件托管在Linux Cpanel Godaddy服务器中。这是我的development.rb配置:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtpout.secureserver.net',
domain: 'mail.[mydomain].com',
port:25,
authentication: 'login',
user_name:'no-reply@[mydomain].mx',
password:'mypassword',
enable_starttls_auto: true
}
端口是80而不是25,并确保您的防火墙不会阻止它
# config/environments/development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'smtpout.secureserver.net',
:domain => 'www.example.com',
:port => 80,
:user_name => 'yourusername@example.com',
:password => 'yourpassword',
:authentication => :plain
}