# Email using ruby on rails

**URL:** <https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059>\
**Category:** Rails\
**Created:** [March 12, 2010, 6:54pm UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059 "2010-03-12T18:54:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manish\_belsare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Post date:** [March 12, 2010, 6:54pm UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059/1 "2010-03-12T18:54:57Z")

</div>

ActionMailer::Base.server\_settings = {  
:address =\> “[smtp.tutorialspoint.com](http://smtp.tutorialspoint.com)”,  
:port =\> 25,  
:domain =\> “[tutorialspoint.com](http://tutorialspoint.com)”,  
:authentication =\> :login,  
:user\_name =\> “username”,  
:password =\> “password”,  
}

Here in this code what shud be the value of “username” and “password”

---

<div class="post-metadata">

**Author:** ![manish\_belsare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Post date:** [March 12, 2010, 8:23pm UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059/2 "2010-03-12T20:23:57Z")

</div>

Manish B. wrote:

> ActionMailer::Base.server\_settings = {  
> :address =\> “[smtp.tutorialspoint.com](http://smtp.tutorialspoint.com)”,  
> :port =\> 25,  
> :domain =\> “[tutorialspoint.com](http://tutorialspoint.com)”,  
> :authentication =\> :login,  
> :user\_name =\> “username”,  
> :password =\> “password”,  
> }
> 
> Here in this code what shud be the value of “username” and “password”

I don’t know; how do you send email? What are your username and  
password? You’ll also want to change the address and domain to fit your  
needs. If you don’t know, ask your IT department, or your ISP, or your  
webhost.

---

<div class="post-metadata">

**Author:** ![manish\_belsare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Post date:** [March 12, 2010, 10:47pm UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059/3 "2010-03-12T22:47:14Z")

</div>

username/password are the credentials to your email account.

# Example smtp gmail settings.

ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.smtp\_settings = {  
:address =\> “[smtp.gmail.com](http://smtp.gmail.com)”,  
:port =\> 587,  
:authentication =\> :plain,  
:enable\_starttls\_auto =\> true,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “sandip”  
}

On Sat, Mar 13, 2010 at 12:53 AM, Aldric G.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> > 
> 
> You received this message because you are subscribed to the Google G.  
> “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to  
> removed\_email\_address@domain.invalid[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> .  
> For more options, visit this group at  
> [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

–  
Sandip

* * *

> **[Fun On Rails](http://funonrails.com/)**
>
> Journal of a Web Developer #ruby #rails #JS

---

<div class="post-metadata">

**Author:** ![manish\_belsare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Post date:** [March 17, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059/4 "2010-03-17T16:26:13Z")

</div>

You’ll also want to change the address and domain to fit your  
needs. If you don’t know, ask your IT department, or your ISP, or your  
webhost.

Sir for your above mentioned thing well is it necessary to know the  
domain and address from my ISP??  
i cant send an email from my application without this…  
Also i would like to mention that the email information is displayed in  
the web server but it is not routed to the mentioned email address…so  
wat should i do?

---

<div class="post-metadata">

**Author:** ![manish\_belsare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Post date:** [March 18, 2010, 7:22am UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059/5 "2010-03-18T07:22:16Z")

</div>

Hi Manish,

Is email sending log is getting created inside log file ?  
Is [tutorialspoint.com](http://tutorialspoint.com) [http://smtp.tutorialspoint.com](http://smtp.tutorialspoint.com) is your domain ?  
If  
yes, then where smtp setup has been done ?  
Why don’t you send emails using gmail account ?

Thanks,

On Wed, Mar 17, 2010 at 8:56 PM, Manish B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> the web server but it is not routed to the mentioned email address…so  
> .  
> For more options, visit this group at  
> [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

–  
Sandip

* * *

> **[Fun On Rails](http://funonrails.com/)**
>
> Journal of a Web Developer #ruby #rails #JS

---

<div class="post-metadata">

**Author:** ![manish\_belsare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Post date:** [March 18, 2010, 10:07am UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059/6 "2010-03-18T10:07:22Z")

</div>

> Why don’t you send emails using gmail account ?

Sir,  
I would surely like to know what i have to make changes in the  
environment.rb file…  
My email information is available in the development.log file…

Sir my environment.rb file has foll contents:

ActionMailer::Base.delivery\_method = :smtp

ActionMailer::Base.smtp\_settings = {  
:address =\> “[smtp.gmail.com](http://smtp.gmail.com)” ,  
:port =\> 25,  
:domain =\> “[gmail.com](http://gmail.com)” ,  
:authentication =\> :login,  
:enable\_starttls\_auto =\> true,  
:user\_name =\> “mukesh” ,  
:password =\> “123456”  
}

Here user name is user name created by the user and not email id…  
so what schanges chould i make to this file?

---

<div class="post-metadata">

**Author:** ![manish\_belsare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7993a0/32.png) [@manish\_belsare](https://www.ruby-forum.com/u/manish_belsare)\
**Post date:** [March 18, 2010, 11:19am UTC](https://www.ruby-forum.com/t/email-using-ruby-on-rails/185059/7 "2010-03-18T11:19:54Z")

</div>

Just remove domain from smtp settings and it should work fine Instead we  
are  
passing it through username.

ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.smtp\_settings = {  
:address =\> “[smtp.gmail.com](http://smtp.gmail.com)”,  
:port =\> 587,  
:authentication =\> :plain,  
:enable\_starttls\_auto =\> true,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “123456”  
}

Let me know if still problem!

On Thu, Mar 18, 2010 at 2:37 PM, Manish B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> Sir my environment.rb file has foll contents:  
> :password =\> “123456”  
> You received this message because you are subscribed to the Google G.  
> “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to  
> removed\_email\_address@domain.invalid[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> .  
> For more options, visit this group at  
> [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

–  
Sandip

* * *

> **[Fun On Rails](http://funonrails.com/)**
>
> Journal of a Web Developer #ruby #rails #JS
