Aaron Castro
Aaron Castro

Reputation: 399

Ruby on Rails error using SMTP Microsoft Exchange mail account

I'm trying to connect to a Microsoft Exchange account deployed in a local server. Accessing to this server requires a VPN connection.

My app its deployed into another server and has access to this VPN.

When I try to send an Email I'm getting this error:

Net::SMTPAuthenticationError: 504 5.7.4 Unrecognized authentication type

These are my stmp_settings:

    config.action_mailer.default_url_options = { :host => ENV['EMAIL_DEFAULT_URL'] }
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
      address: 'example.com',
      port: 25,
      domain: ENV['EMAIL_DOMAIN'],
      authentication: :login,
      user_name: ENV['EMAIL_USERNAME'],
      password: ENV['EMAIL_PASSWORD'],
      openssl_verify_mode: 'none'
    }

Thanks!

Upvotes: 1

Views: 597

Answers (1)

BastianW
BastianW

Reputation: 2658

Try to send an email via telnet at first. Then check which error message you get. Based on that test you can then build the needed configure.

As discussed in the comments already "plaintext authentication" might be the best option but you can find that out via telnet.

Upvotes: 1

Related Questions