Ruby Forum Ruby on Rails > Actionmailer not working [no errors]

Posted by Kr Alfabeta (kristis)
on 20.04.2008 15:48
hi,

I have a little problem with actionmailer 2.0.2

The problem is that I am trying to send mails and development.log says
that everything is ok but I can't find any mails in my mailbox.

I checked my sendmail with PHP function "mail()" - works nice.

/var/log/mail.log don't drop any lines when sending mails with
actionmailer.

So in conclusion no errors and no way to check where delivery fails.

Could you help me with this?
Posted by Rails Terrorist (malioboro)
on 20.04.2008 17:02
There's many options to send email using action mailer :

[1] You can use gmail account for your action mailer
Read it : 
http://teapoci.blogspot.com/2008/04/action-mailer-with-gmail-or-another.html

[2] You can use email domain, the way is the same like above you only 
change it :

:address => "smtp.yourdomain.com",
:port => 25, # default is 25 but you can use also 26
:domain => 'yourdomain.com',
:user_name => "your_username@yourdomain.com",

[3] If you are using linux OS, the last line paste it in 
config/environment.rb:

ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"

[4] Some times this script is never working or never sending email any 
more :

ActionMailer::Base.smtp_settings = {
:address => 'smtp.domain.com', # default: localhost
:port => '25', # default: 25
:authentication => :plain, # :plain, :login or :cram_md5
:user_name => 'teapoci',
:password => 'xxxxxx'
}


I not recommend you for option no. 4, because it never works to me too. 
Have nice try.


Enjoy,
Reinhart
http://teapoci.blogspot.com
Posted by Kr Alfabeta (kristis)
on 20.04.2008 18:59
> [3] If you are using linux OS, the last line paste it in 
> config/environment.rb:
> 
> ActionMailer::Base.delivery_method = :sendmail
> ActionMailer::Base.perform_deliveries = true
> ActionMailer::Base.raise_delivery_errors = true
> ActionMailer::Base.default_charset = "utf-8"

The configuration in my environment.rb is the same as here. No solution 
yet...
Posted by Frederick Cheung (Guest)
on 20.04.2008 19:16
(Received via mailing list)
On 20 Apr 2008, at 17:59, Kr Alfabeta wrote:

> The configuration in my environment.rb is the same as here. No  
> solution
> yet...

Is sendmail where rails expects it to be? By default it looks for it
at /usr/sbin/sendmail, you can change that by setting
ActionMailer::Base.sendmail_settings[:location]

Fred
Posted by Kr Alfabeta (kristis)
on 20.04.2008 19:25
> Is sendmail where rails expects it to be? By default it looks for it
> at /usr/sbin/sendmail, you can change that by setting
> ActionMailer::Base.sendmail_settings[:location]
> 
> Fred

x28:/home/xxx# locate sendmail
/usr/lib/sendmail
/usr/sbin/sendmail
Posted by Kr Alfabeta (kristis)
on 21.04.2008 20:04
More info: my rails application runs under apache but when I run it by 
default with ./script/server (WEBrick) actionmailer WORKS.

Where is the problem? permissions?
Posted by Kr Alfabeta (kristis)
on 21.04.2008 20:54
Kr Alfabeta wrote:
> More info: my rails application runs under apache but when I run it by 
> default with ./script/server (WEBrick) actionmailer WORKS.
> 
> Where is the problem? permissions?

Solved. permissions. thank you for trying
Posted by Rails Terrorist (malioboro)
on 21.04.2008 20:55
Sometimes port 25/26 is blocked to send email, and some email providers 
are refusing to receive email from port 25 that uses localhost smtp. 
Yahoo and Gmail are the most email provider that is not too extrem in 
filtering incoming email.

Another reason, your email isn't delivered well is your header or format 
of sendemail. Checkout your development.log, if there is 200K OK, or 
notification that actionmailer was working but you still cant receive 
email. it means that your problem is from your localhost. Maybe your 
internet provider is blocking or dont want send you email from localhost 
port 25 or 26.


Reinhart
http://teapoci.blogspot.com
Posted by Rails Terrorist (malioboro)
on 21.04.2008 20:57
Visit Indonesia 2008 wrote:

> Yahoo and Gmail are the most email provider that is not too extrem in 
> filtering incoming email.

CORRECTION: Yahoo and Gmail are the most email provider that ARE TOO 
extrem in filtering incoming email. Nowdays spam issue is the top issue 
in emailing or between email providers.

reinhart