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

Posted by Kr Alfabeta (kristis)
on 2008-04-20 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 Yacobus Reinhart (malioboro)
on 2008-04-20 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-...

[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 2008-04-20 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 2008-04-20 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 2008-04-20 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 2008-04-21 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 2008-04-21 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 Yacobus Reinhart (malioboro)
on 2008-04-21 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 Yacobus Reinhart (malioboro)
on 2008-04-21 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

Posted by Mike Gauthier (mgauthier)
on 2010-06-18 20:36
What permissions did you have to change?


Kr Alfabeta wrote:
> 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 Jj Lumagbas (jjlumagbas)
on 2010-09-08 11:37
Kr Alfabeta wrote:
> 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

I also have this problem. Mail is sent with script/server, but not when 
running thin. What permissions did you change to solve this?
Posted by Joao Silva (rubyforum)
on 2011-06-03 14:31
Jj Lumagbas wrote in post #939126:
> Kr Alfabeta wrote:
>> 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
>
> I also have this problem. Mail is sent with script/server, but not when
> running thin. What permissions did you change to solve this?

I have the same Problem!!

PLEASE HELP!
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.