# "Authentication failed" when third party smtp server is used

**URL:** <https://www.ruby-forum.com/t/authentication-failed-when-third-party-smtp-server-is-used/165803>\
**Category:** Rails\
**Created:** [April 17, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/authentication-failed-when-third-party-smtp-server-is-used/165803 "2009-04-17T18:01:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankit2584](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Post date:** [April 17, 2009, 6:01pm UTC](https://www.ruby-forum.com/t/authentication-failed-when-third-party-smtp-server-is-used/165803/1 "2009-04-17T18:01:32Z")

</div>

Hello,  
I am using action mailer to send mails. I need to use a third party  
smtp server. The third party smtp server i am using is authsmtp.

```
ActionMailer::Base.smtp_settings = {
:address => "mail.authsmtp.com",
:domain => "mydomain.com",
:port => 2525,
:authentication => "login",
:user_name => "removed_email_address@domain.invalid",
:password => "password for removed_email_address@domain.invalid"

```

}

when i try to send the mail, i get authentication failed error. but if i  
change the :address to [mail.mydomain.com](http://mail.mydomain.com) everything works fine.  
I want to use authsmtp to send mail

I think i also have to authenticate the authsmtp server.I have its  
username and password. Where do i have to write that.

Any idea whats going wrong.  
Please help  
Thank you.

---

<div class="post-metadata">

**Author:** ![ankit2584](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Post date:** [April 18, 2009, 3:22am UTC](https://www.ruby-forum.com/t/authentication-failed-when-third-party-smtp-server-is-used/165803/2 "2009-04-18T03:22:29Z")

</div>

On Apr 17, 5:01 pm, Ank Ag [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> when i try to send the mail, i get authentication failed error. but if i  
> change the :address to [mail.mydomain.com](http://mail.mydomain.com) everything works fine.  
> I want to use authsmtp to send mail
> 
> I think i also have to authenticate the authsmtp server.I have its  
> username and password. Where do i have to write that.

You should be using that username and password in your smtp settings.

Fred
