# Cant send email

**URL:** <https://www.ruby-forum.com/t/cant-send-email/158654>\
**Category:** Rails\
**Created:** [January 26, 2009, 1:52pm UTC](https://www.ruby-forum.com/t/cant-send-email/158654 "2009-01-26T13:52:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Raafay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@Muhammad\_Raafay](https://www.ruby-forum.com/u/Muhammad_Raafay)\
**Post date:** [January 26, 2009, 1:52pm UTC](https://www.ruby-forum.com/t/cant-send-email/158654/1 "2009-01-26T13:52:26Z")

</div>

Dear Friends,  
I am new to rails.I am developing a test application. I have to send  
emails .I have rails 2.2.2  
and made following changes to “application.rb”

* * *

ActionMailer::Base.delivery\_method = :smtp

ActionMailer::Base.smtp\_settings = {  
:address =\> ‘[smtp.gmail.com](http://smtp.gmail.com)’,  
:port =\> 587,  
:domain =\> ‘[gmail.com](http://gmail.com)’,  
:authentication =\> :plain,  
:user\_name =\> ‘removed\_email\_address@domain.invalid’,  
:password =\> ‘lionesss’,  
:tls =\> true

}

* * *

When i send email i get no error but the following message in prompt

* * *

Processing AddressBooksController#addFriends (for 127.0.0.1 at  
2009-01-26 14:23:41) [GET]  
Parameters: {“final”=\>“1”, “email0”=\>“removed\_email\_address@domain.invalid”}  
Redirected to /address\_books/sendmail?nameOfSender=muhammad  
Completed in 3ms (DB: 0) | 302 Found [[http://127.0.0.1/address\_books/](http://127.0.0.1/address_books/)  
addFriends?final=1&email0=raafay86%[40gmail.com](http://40gmail.com)]

Processing AddressBooksController#sendmail (for 127.0.0.1 at  
2009-01-26 14:23:42) [GET]  
Parameters: {“nameOfSender”=\>“muhammad”}  
Sent mail to removed\_email\_address@domain.invalid

Date: Mon, 26 Jan 2009 14:23:42 +0500  
From: removed\_email\_address@domain.invalid  
To: removed\_email\_address@domain.invalid  
Subject: Invitation from BizCar  
Mime-Version: 1.0  
Content-Type: text/plain; charset=utf-8

 Untitled Document Completed in 11ms (View: 0, DB: 0) | 200 OK [http://127.0.0.1/ address\_books/sendmail?nameOfSender=muhammad]
* * *

The message shows as if email has been sent but i receive no email at  
removed\_email\_address@domain.invalid  
Can anybody help me out.  
Thanks!!!

---

<div class="post-metadata">

**Author:** ![Muhammad\_Raafay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@Muhammad\_Raafay](https://www.ruby-forum.com/u/Muhammad_Raafay)\
**Post date:** [January 27, 2009, 7:47am UTC](https://www.ruby-forum.com/t/cant-send-email/158654/2 "2009-01-27T07:47:09Z")

</div>

Hello Muhammad,

I assume you’ve already installed action\_mailer\_optional\_tls so I  
won’t say to do that.

I use:

ActionMailer::Base.smtp\_settings = {  
:tls =\> true,  
:address =\> “[smtp.gmail.com](http://smtp.gmail.com)”,  
:port =\> 25,  
:domain =\> “[gmail.com](http://gmail.com)”,  
:authentication =\> :login,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “…”  
}

But I also needed to make a change to smtp\_tls.rb so it would work  
with Ruby 1.8.7. Specifically:

Change:

check\_auth\_args user, secret, authtype if user or secret  
To:

```
check_auth_args user, secret if user or secret

```

As for some reason check\_auth\_args went from 3 args to 2.

Rick
