Mandrill电子邮件不是从本地应用程序发送

时间:2022-01-28 18:13:44

I have configured my local environment as like this

我已经像这样配置了我的本地环境

config.action_mailer.smtp_settings = {
  address: "smtp.mandrillapp.com",
  port: 587,
  domain: ENV["DOMAIN_NAME"],
  authentication: "plain",
  enable_starttls_auto: true,
  user_name: "username",
  password: "api key
}

When I send email from my app I got this error

当我从我的应用程序发送电子邮件时,我收到此错误

Net::SMTPServerBusy in MailsController#import 401 Syntax: HELO hostname

MailsController中的Net :: SMTPServerBusy #import 401语法:HELO主机名

when I change config from mandrill to gmail, I can send email from my app. I dont know what's wrong.

当我将配置从mandrill更改为gmail时,我可以从我的应用程序发送电子邮件。我不知道什么是错的。

Thanks for your time.

谢谢你的时间。

1 个解决方案

#1


0  

This is not only related to Ruby.

这不仅与Ruby有关。

On this document: http://logback.qos.ch/manual/appenders.html

在此文档:http://logback.qos.ch/manual/appenders.html

We can find a param "hostname" with some documentation:

我们可以找到一个包含一些文档的参数“hostname”:

In case the hostname of the SMTP client is not properly configured, e.g. if the client hostname is not fully qualified, certain SMTP servers may reject the HELO/EHLO commands sent by the client. To overcome this issue, you may set the value of the localhost property to the fully qualified name of the client host. See also the "mail.smtp.localhost" property in the documentation for the com.sun.mail.smtp package.

如果未正确配置SMTP客户端的主机名,例如如果客户端主机名不是完全限定的,则某些SMTP服务器可能会拒绝客户端发送的HELO / EHLO命令。要解决此问题,可以将localhost属性的值设置为客户端主机的完全限定名称。另请参阅com.sun.mail.smtp包文档中的“mail.smtp.localhost”属性。

So according to the packjage doc, if you are on the Java world you could use this option -Dmail.smtp.localhost=someHostName

所以根据packjage文档,如果你在Java世界,你可以使用这个选项-Dmail.smtp.localhost = someHostName

Local host name used in the SMTP HELO or EHLO command. Defaults to InetAddress.getLocalHost().getHostName(). Should not normally need to be set if your JDK and your name service are configured properly.

SMTP HELO或EHLO命令中使用的本地主机名。默认为InetAddress.getLocalHost()。getHostName()。如果您的JDK和您的名称服务配置正确,通常不需要设置。

So I guess there may be something wrong configured in your OS and your Ruby client can't get a proper Fully Qualified Domain Name.

所以我猜你的操作系统中可能有一些错误配置,你的Ruby客户端无法获得正确的完全限定域名。

One teammate had this problem on its MacOS laptop. She used the Java option so I can't tell you more :)

一位队友在MacOS笔记本电脑上遇到了这个问题。她使用Java选项,所以我不能告诉你更多:)

#1


0  

This is not only related to Ruby.

这不仅与Ruby有关。

On this document: http://logback.qos.ch/manual/appenders.html

在此文档:http://logback.qos.ch/manual/appenders.html

We can find a param "hostname" with some documentation:

我们可以找到一个包含一些文档的参数“hostname”:

In case the hostname of the SMTP client is not properly configured, e.g. if the client hostname is not fully qualified, certain SMTP servers may reject the HELO/EHLO commands sent by the client. To overcome this issue, you may set the value of the localhost property to the fully qualified name of the client host. See also the "mail.smtp.localhost" property in the documentation for the com.sun.mail.smtp package.

如果未正确配置SMTP客户端的主机名,例如如果客户端主机名不是完全限定的,则某些SMTP服务器可能会拒绝客户端发送的HELO / EHLO命令。要解决此问题,可以将localhost属性的值设置为客户端主机的完全限定名称。另请参阅com.sun.mail.smtp包文档中的“mail.smtp.localhost”属性。

So according to the packjage doc, if you are on the Java world you could use this option -Dmail.smtp.localhost=someHostName

所以根据packjage文档,如果你在Java世界,你可以使用这个选项-Dmail.smtp.localhost = someHostName

Local host name used in the SMTP HELO or EHLO command. Defaults to InetAddress.getLocalHost().getHostName(). Should not normally need to be set if your JDK and your name service are configured properly.

SMTP HELO或EHLO命令中使用的本地主机名。默认为InetAddress.getLocalHost()。getHostName()。如果您的JDK和您的名称服务配置正确,通常不需要设置。

So I guess there may be something wrong configured in your OS and your Ruby client can't get a proper Fully Qualified Domain Name.

所以我猜你的操作系统中可能有一些错误配置,你的Ruby客户端无法获得正确的完全限定域名。

One teammate had this problem on its MacOS laptop. She used the Java option so I can't tell you more :)

一位队友在MacOS笔记本电脑上遇到了这个问题。她使用Java选项,所以我不能告诉你更多:)