使用 Godaddy 邮件和 Rails 3 进行 SMTP 设置

发布于 2024-11-04 04:59:13 字数 45 浏览 4 评论 0原文

我应该如何使用 Godaddy 邮件在初始化程序文件中设置 SMTP 设置?

How should I set up my SMTP settings in my initializer file using Godaddy mail?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风向决定发型 2024-11-11 04:59:13

无耻地摘自此处的文章: http://pilotoutlook.wordpress.com/2008/10/13/setup-email-in-ruby-on-rails-using-godaddysmtp/

打开ROOT/config/environment.rb文件
对于 sendmail,添加以下行 -

ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.smtp_settings = {
:domain  => ‘www.example.com’
}

对于 Godaddy,添加以下行 -

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => ‘smtpout.secureserver.net’,
:domain  => ‘www.example.com’,
:port      => 80,
:user_name => ‘[email protected]’,
:password => ‘yourpassword’,
:authentication => :plain
}

保存并重新启动您的网络服务器。你已经准备好了。

请记住,您每天只能从 Godaddy 发送 300 封电子邮件,因此如果您需要发送更多电子邮件,则必须使用 sendmail 或其他解决方案。

请注意,端口未设置为 25 - 这是故意的。 GoDaddy 的电子邮件服务器配置为使用多个端口,以防 25 被阻止。

Shamelessly taken from the article here: http://pilotoutlook.wordpress.com/2008/10/13/setup-email-in-ruby-on-rails-using-godaddysmtp/

Open ROOT/config/environment.rb file
For sendmail, add following lines -

ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.smtp_settings = {
:domain  => ‘www.example.com’
}

For Godaddy, add following lines -

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => ‘smtpout.secureserver.net’,
:domain  => ‘www.example.com’,
:port      => 80,
:user_name => ‘[email protected]’,
:password => ‘yourpassword’,
:authentication => :plain
}

Save and restart your webserver. You are all set.

Remember that you can only send 300 emails per day from Godaddy, so if you need to send more emails, you will have to use sendmail or some other solution.

Note the port is NOT set to 25 - this is on purpose. GoDaddy's email servers are configured to use several ports, just in case 25 is blocked.

我喜欢麦丽素 2024-11-11 04:59:13
# config/environments/production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address => 'smtpout.secureserver.net',
  :domain  => 'www.example.com',
  :port      => 80,
  :user_name => '[email protected]',
  :password => 'yourpassword',
  :authentication => :plain
}
# config/environments/production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address => 'smtpout.secureserver.net',
  :domain  => 'www.example.com',
  :port      => 80,
  :user_name => '[email protected]',
  :password => 'yourpassword',
  :authentication => :plain
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文