Email using ruby on rails

ActionMailer::Base.server_settings = {    :address => "smtp.tutorialspoint.com",    :port => 25,    :domain => "tutorialspoint.com",    :authentication => :login,    :user_name => "username",    :password => "password", }

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

Manish Belsare wrote:

ActionMailer::Base.server_settings = {    :address => "smtp.tutorialspoint.com",    :port => 25,    :domain => "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.

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 => "sandip@gmail.com",

:password => "sandip"

}

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?

Hi Manish,

Is email sending log is getting created inside log file ?

Is tutorialspoint.com is your domain ? If yes, then where smtp setup has been done ?

Why don’t you send emails using gmail account ?

Thanks,

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" ,   :port => 25,   :domain => "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?

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 => "mukesh@gmail.com",

:password => "123456"

}

Let me know if still problem!