Hi all i am trying to send mail but i could not send it and at the end it is redirecting to right page but mail is not receiving.
i got this in my log
Sent mail to mailid
Date: Tue, 18 Sep 2012 19:38:51 +0530
From: xxxx
To: xxxx
Subject: fdfdsafsdafdsfsfsdafdsf
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
dfsadfdsfsdafsfsdfsdfsd
Redirected to
http://localhost:3000/student/profile/776Completed in 5696ms (DB: 3) | 302 Found [
http://localhost/student/email/776]
UserMailer::deliver_email(sender, recipient_list, params['email']['subject'], params['email']['message'])
class UserMailer < ActionMailer::Base
def email(sender,recipients, subject, message)
recipient_emails = (recipients.class == String) ? recipients.gsub(' ','').split(',').compact : recipients.compact
setup_email(sender, recipient_emails, subject, message)
end
protected
def setup_email(sender, emails, subject, message)
logger.info"i am in SETUP"
@from = sender
@recipients = emails
@subject = subject
@sent_on = Time.now
@body['message'] = message
end
end
Config/intializers/smtp_gmail
ActionMailer::Base.smtp_settings = {
:address => "
smtp.gmail.com",
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true,
:user_name => "xxxx",
:password => "xxxxx"
}
till def setup_email i am able to reach it but i am not receiving mail.
Cheers,
KP