Actionmailer cant sent the mail

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 = ‘[email protected]
@sent_on = sent_at
body[“title”] = ‘This is title’
body[“email”] = ‘[email protected]
body[“message”] = message
@content_type = “text/html”

  @headers['Reply-To'] = "'Webmaster' <[email protected]>"

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 => “[email protected]”,
: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”=>“[email protected]”,
“subject”=>“HIiii”}}
Sent mail:
Date: Wed, 16 Apr 2008 17:11:41 +0530

From: [email protected]

Reply-To: ‘Saurav’ [email protected]

Subject: Hi

Mime-Version: 1.0

Content-Type: text/html; charset=utf-8

Hi!

You are having one email message from [email protected] 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

On 17 Apr 2008, at 10:55, Saurav C. 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

Thanx a lot for the help…I dont know how I missed that

Frederick C. wrote:

On 17 Apr 2008, at 10:55, Saurav C. 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs