ActionMailer 501: sender address must contain a domain

Hi there guys!

Im copying an email example from “Agile web development with rails”, but
i keep getting a “501: sender address must contain a domain” error.

Heres my code in my enviroment.rb. Real values replaced with
“something”:

  config.action_mailer.delivery_method = :smtp
  config.action_mailer.default_charset ="utf-8"
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true

  config.action_mailer.server_settings = {
    :address => "something.something.net",
    :port => 25,
    :domain => "something.com",
    :user_name => "[email protected]",
    :password => "something",
    :authentication => :login
    }

And heres my method:

def confirm(customer)
    @subject    = 'Sign up verification'
    @body["customer"] = customer
    @recipients = customer.email
    @from       = 'SilverSky'
    @sent_on    = Time.now
  end

  def send_mail
    customer = Customer.find_by_firstname("erkan1")
    email = CustomerMailer.create_confirm(customer)
    email.set_content_type("text/html")
    if CustomerMailer.deliver(email)
    render(:text => "Thank you" )
  end

Any help would be greatly appreciated! This is getting me down!

On Nov 17, 2007, at 6:36 AM, Serkan S. wrote:

Hi there guys!

Im copying an email example from “Agile web development with rails”,
but
i keep getting a “501: sender address must contain a domain” error.

@from = ‘SilverSky’

There’s your problem. That needs to be an email address.

it works!! thank you George!!! thanks so much!!!