Email issues

I am having troubles getting the email configured to work properly.

On the development side I have updated the config settings to throw
errors if they occur, but the email seems to go through ok, but I never
receive the email.

On the production server I get the following error message when creating
a user that emails a confirmation via the after_create method.

Loading production environment (Rails 2.0.2)

User.create({

?> :login => “admin”,
?> :password => “XXXXX”,
?> :password_confirmation => “XXXXX”,
?> :first_name => “john”,
?> :last_name => “doe”,
?> :email => “[email protected]

})

Net::SMTPFatalError: 554 Message refused.

On both servers I am using sendmail, although on the development server
I have also tried smtp (config.action_mailer.delivery_method =
:sendmail).

Both severs also have the sendmail file in the /usr/sbin folder.

Thanks for any help.

Test the sendmail installation from the command line. Make sure you
don’t
have any permission issues. There is no configuration required for
sendmail.
Rails will automagically send mails.

On Dec 24, 2007 10:13 AM, Chris O. [email protected]
wrote:

On the production server I get the following error message when creating

Net::SMTPFatalError: 554 Message refused.

On both servers I am using sendmail, although on the development server
I have also tried smtp (config.action_mailer.delivery_method =
:sendmail).


http://www.rubyplus.org/
Free Ruby Screencasts

Hey Bala,

I was just able to get the development version sending emails with
sendmail (and smtp), and the only thing that I can think of why it now
works was probably due to a server restart.

I made the mistake of saying that previously the server was using
sendmail, which it wasn’t, but rather it was using smtp. I did try
restarting the server with those same settings to no avail. I have also
set the server to use sendmail and am now able to create users from the
console (email failure doesn’t cause rollback), but I am not receiving
any emails.

I am not sure what the problem is now.

Thanks for the help.

Test email addresses with different domains. Is the mail server running
on
the local server where your Rails app is deployed? Can you connect email
client such as Apple Mail using the SMTP server settings and send email?

If the mail server is configured properly, you should define the mail
server
settings in the appropriate environment config file, ex - for production
,
define it in production.rb. In Rails 2.0 the syntax has changed:

ActionMailer::Base.smtp_settings = define_your_server_settings

On Dec 24, 2007 11:22 AM, Chris O. [email protected]
wrote:

Hey Bala,

I was just able to get the development version sending emails with
sendmail (and smtp), and the only thing that I can think of why it now
works was probably due to a server restart.


http://www.rubyplus.org/
Free Ruby and Rails Screencasts

Use email client such as ms outlook, eudora etc and use the parameters
u r using in the rails app to connect to the email server. Check if u
can send any email.

Sent from my iPhone

On Dec 24, 2007, at 5:26 PM, Chris O.
<[email protected]

wrote:

Can you connect email client such as Apple Mail using the SMTP
server settings and send email?

Not sure what you mean

Bala P. wrote:

Test email addresses with different domains.

Doesn’t email to any of them.

Is the mail server running on
the local server where your Rails app is deployed?

It is

Can you connect email client such as Apple Mail using the SMTP server settings and send email?

Not sure what you mean

If the mail server is configured properly, you should define the mail server
settings in the appropriate environment config file, ex - for production,
define it in production.rb. In Rails 2.0 the syntax has changed:

ActionMailer::Base.smtp_settings = define_your_server_settings

I am using sendmail right now so I don’t have any server settings.
config.action_mailer.delivery_method = :sendmail

I will try to see if smtp works with the settings in the 2.0 format.

To test this I reverted back to my config settings I used before (smtp)
to test this and it now works. I have no idea why it is working now,
but I am happy.

Thanks for the help.

Bcp wrote:

Use email client such as ms outlook, eudora etc and use the parameters
u r using in the rails app to connect to the email server. Check if u
can send any email.

Sent from my iPhone

On Dec 24, 2007, at 5:26 PM, Chris O.
<[email protected]

wrote:

Can you connect email client such as Apple Mail using the SMTP
server settings and send email?

Not sure what you mean

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