简体   繁体   中英

How to test that my installer Rails mailer is working

I am trying to install the rails mailer following this tutorial:

http://guides.rubyonrails.org/action_mailer_basics.html

I didn't follow it exactly because I didn't want to use scaffold as they suggest. But overall, I am following it pretty closely.

I installed the components, added the emails that are supposed to get sent out and at least got the program to the point where it doesn't give me syntax errors when I am trying to invoke the code to send an email.

I also made sure my OS is able to send emails.

The only problem is that no email is getting sent when I am invoking that ruby on rails program to do it. The server log is not complaining about anything else either.

What is a good way to debug the mailer to find where the problem is occurring? Here is what the logs say:

Started GET "/" for 127.0.0.1 at 2011-05-26 11:46:26 -0700
  Processing by HomeController#index as HTML
  User Load (0.1ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
Rendered user_mailer/welcome_email.html.erb (0.4ms)
Rendered user_mailer/welcome_email.text.erb (0.4ms)

Sent mail to alex.genadinik@gmail.com (17ms)
Date: Thu, 26 May 2011 11:46:26 -0700
From: agenadinik@udfr.com
To: alex.genadinik@gmail.com
Message-ID: <4ddea0028f37d_47e5537cdf036221@slabrams-desktop.mail>
Subject: Welcome to the site
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="--==_mimepart_4ddea00285ec9_47e5537cdf0359f3";
 charset=UTF-8
Content-Transfer-Encoding: 7bit

But I get no email sent to alex.genadinik@gmail.com Any idea why or where to look next to debug? :)

It seems your application is sending emails. Probably some issue with SMTP settings (or whichever mail type you are using) you have in your environment file. Double check them and try debugging it at the mail server end by looking at the logs of the mail server. Verify whether it is receiving a request and is able to send the mail to the required address.

But before you do any of that, check your SPAM folder.....maybe your email has landed there.... ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM