简体   繁体   中英

Mandrill email not send from local app

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

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

Thanks for your time.

This is not only related to Ruby.

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

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

In case the hostname of the SMTP client is not properly configured, eg 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.

So according to the packjage doc, if you are on the Java world you could use this option -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.

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 .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM