将邮件发送到配置的smtp服务器

时间:2022-02-03 18:14:03

I have following configuration lines written in mailer.rb file to send mails using a particular sever.

我在mailer.rb文件中编写了以下配置行,以使用特定服务器发送邮件。

config.active_record.default_timezone = :local

config.action_mailer.smtp_settings = {
    :address => "abcprojsmtp",
    :port => 25,
    :authentication => :login
}

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true

Mails are not reaching the destination.

邮件没有到达目的地。

Are there any other configurations missing? Please help me with this.

是否缺少其他配置?请帮我解决一下这个。

2 个解决方案

#1


I like to put the ActionMailer settings in environment.rb or in the respective environment/ files. You have more control over how mail is being sent while developing the app.

我喜欢将ActionMailer设置放在environment.rb或相应的环境/文件中。在开发应用程序时,您可以更好地控制邮件的发送方式。

My guess is you will also need the :user_name and :password options...

我的猜测是你还需要:user_name和:password选项......

#2


Issue is resolved... it required additonal Domain name to be specified.

问题已解决...需要指定附加域名。

It worked :)

有效 :)

#1


I like to put the ActionMailer settings in environment.rb or in the respective environment/ files. You have more control over how mail is being sent while developing the app.

我喜欢将ActionMailer设置放在environment.rb或相应的环境/文件中。在开发应用程序时,您可以更好地控制邮件的发送方式。

My guess is you will also need the :user_name and :password options...

我的猜测是你还需要:user_name和:password选项......

#2


Issue is resolved... it required additonal Domain name to be specified.

问题已解决...需要指定附加域名。

It worked :)

有效 :)