Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AUTH not available (Net::SMTPAuthenticationError) in Ruby 1.9.2

Tags:

ruby

smtp

I am trying to send mail from MS exchange server but I am getting error as

`check_auth_response': 503 #5.3.3 AUTH not available (Net::SMTPAuthenticationError)

The code I used to send mail is

require 'net/smtp'
require 'mail'

smtp = Net::SMTP.new('mycompanydomain',25)
smtp.start('mycompanydomain', '[email protected]', 'pwd',:plain) do |smtp|
  # code to send mail
end

Note: It works fine with Gmail account but fails for company account. Any help would be useful.

like image 210
Dhepthi Avatar asked Nov 13 '22 11:11

Dhepthi


1 Answers

Are you sure that your server supports AUTH? You can find out by:

If the connection is not encrypted:

telnet mycompanydomain 25
ehlo testing

It should respond with something that that says AUTH PLAIN in it. If it doesn't, your server does not support plain auth, it may list other auth methods. You may need to set it to one of them.

More information http://qmail.jms1.net/test-auth.shtml

like image 173
Michael Papile Avatar answered Dec 09 '22 11:12

Michael Papile