Hi everybody,
Im facing problems in sending mail using actionmailer. Im trying to do a
simple stuff where user types in his message and the receiptent email
address, the n that message should be received by the receiptent. I have
checked the development.log file, but there I havent noticed any error,
the workflow of the program is fine, but at the end of the day, the
receiptent is not receiving the mail
Below is the controller file:
class EmailerController < ApplicationController
def sendmail
recipient = params[:reciptent]
subject = params[:subject]
message = params[:message]
Emailer.deliver_contact(recipient, subject, message)
return if request.xhr?
render :text => ''Message sent successfully''
end
thiis is the emailer class:
class Emailer < ActionMailer::Base
def contact(recipient, subject, message, sent_at = Time.now)
@subject = subject
@recipients = recipient
@from =
''<webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org>''
@sent_on = sent_at
body["title"] = ''This is title''
body["email"] =
''webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org''
body["message"] = message
@content_type = "text/html"
@headers[''Reply-To''] =
"''Webmaster''
<webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org>"
end
end
This the settings that I have put in environment.rb file
ActionMailer::Base.raise_delivery_errors = true;
ActionMailer::Base.delivery_method = :smtp;
ActionMailer::Base.smtp_settings = {
:address => "smtp.bizmail.yahoo.com",
:port => 25,
:domain => "bizmail.yahoo.com",
:authentication => :plain,
:user_name => "webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org",
:password => "somepassword"
}
and this is the setting is development.rb file
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
this is output is my development log file
Processing EmailerController#sendmail (for 127.0.0.1 at 2008-04-16
17:11:41) [POST]
Session ID:
BAh7BzoMY3NyZl9pZCIlZjZiYjY5NmMzZTM1YzUzZTRjMDY4ZWQ4MjU2NzJi%0ANWQiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D--ff14f980e27ff9a4a3edfb58c9afd2b1375d0587
Parameters: {"commit"=>"Send",
"authenticity_token"=>"7c49f8693944b6af67e8ed12b38de4b6fa7db513",
"action"=>"sendmail",
"controller"=>"emailer",
"email"=>{"message"=>"klfdglkdfj",
"recipient"=>"<prionko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>",
"subject"=>"HIiii"}}
Sent mail:
Date: Wed, 16 Apr 2008 17:11:41 +0530
From: webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org
Reply-To: ''Saurav''
<webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org>
Subject: Hi
Mime-Version: 1.0
Content-Type: text/html; charset=utf-8
Hi!
You are having one email message from
webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org with a
tilte
This is title
and following is the message:
Thanks
Completed in 3.75000 (0 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.00000 (0%) | 200 OK [http://localhost/emailer/sendmail]
-----------------------------------------------
Please guys help me out ....
Thanks
-Saurav
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On 17 Apr 2008, at 10:55, Saurav Chakraborty wrote:> > Hi everybody, > Im facing problems in sending mail using actionmailer. Im trying to > do a > simple stuff where user types in his message and the receiptent email > address, the n that message should be received by the receiptent. I > have > checked the development.log file, but there I havent noticed any > error, > the workflow of the program is fine, but at the end of the day, the > receiptent is not receiving the mail > > Below is the controller file: > > class EmailerController < ApplicationController > def sendmail > recipient = params[:reciptent]You''ve got a typo, and so you''re not setting the recipient (notice in the log how it doesn''t say who the email is sent to ) Fred> > subject = params[:subject] > message = params[:message] > Emailer.deliver_contact(recipient, subject, message) > return if request.xhr? > render :text => ''Message sent successfully'' > end > > > thiis is the emailer class: > > class Emailer < ActionMailer::Base > def contact(recipient, subject, message, sent_at = Time.now) > @subject = subject > @recipients = recipient > @from = ''<webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org>'' > @sent_on = sent_at > body["title"] = ''This is title'' > body["email"] = ''webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org'' > body["message"] = message > @content_type = "text/html" > > @headers[''Reply-To''] = "''Webmaster'' <webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org>" > end > end > > > This the settings that I have put in environment.rb file > > ActionMailer::Base.raise_delivery_errors = true; > ActionMailer::Base.delivery_method = :smtp; > > > ActionMailer::Base.smtp_settings = { > :address => "smtp.bizmail.yahoo.com", > :port => 25, > :domain => "bizmail.yahoo.com", > :authentication => :plain, > :user_name => "webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org", > :password => "somepassword" > } > > and this is the setting is development.rb file > > config.action_mailer.raise_delivery_errors = true > config.action_mailer.delivery_method = :smtp > > > this is output is my development log file > > > Processing EmailerController#sendmail (for 127.0.0.1 at 2008-04-16 > 17:11:41) [POST] > Session ID: > BAh7BzoMY3NyZl9pZCIlZjZiYjY5NmMzZTM1YzUzZTRjMDY4ZWQ4MjU2NzJi > %0ANWQiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh > %0Ac2h7AAY6CkB1c2VkewA%3D--ff14f980e27ff9a4a3edfb58c9afd2b1375d0587 > Parameters: {"commit"=>"Send", > "authenticity_token"=>"7c49f8693944b6af67e8ed12b38de4b6fa7db513", > "action"=>"sendmail", "controller"=>"emailer", > "email"=>{"message"=>"klfdglkdfj", "recipient"=>"<prionko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>", > "subject"=>"HIiii"}} > Sent mail: > Date: Wed, 16 Apr 2008 17:11:41 +0530 > > From: webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org > > Reply-To: ''Saurav'' <webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org> > > Subject: Hi > > Mime-Version: 1.0 > > Content-Type: text/html; charset=utf-8 > > > > Hi! > > You are having one email message from webmaster-hoIdz7xTBwydGQ+YCijsmw@public.gmane.org > with a > tilte > > This is title > and following is the message: > > > Thanks > Completed in 3.75000 (0 reqs/sec) | Rendering: 0.00000 (0%) | DB: > 0.00000 (0%) | 200 OK [http://localhost/emailer/sendmail] > > ----------------------------------------------- > > > Please guys help me out .... > > > Thanks > -Saurav > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanx a lot for the help....I dont know how I missed that Frederick Cheung wrote:> On 17 Apr 2008, at 10:55, Saurav Chakraborty wrote: > >> receiptent is not receiving the mail >> >> Below is the controller file: >> >> class EmailerController < ApplicationController >> def sendmail >> recipient = params[:reciptent] > > You''ve got a typo, and so you''re not setting the recipient (notice in > the log how it doesn''t say who the email is sent to ) > > Fred-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---