Željko Filipin's Blog on Software and Testing

Test like you do not need the money.

Test If Application Sends Correct E-mails

with 2 comments

Interesting question appeared today at wtr-general mailing list.

my application has sent an email to outlook. i want watir to open outlook, open the mail and get the mail data like from text and so on.

I also have to test my application to see if it sends correct e-mails. So I knew the answer.

You do not have to open Outlook to see your mail. You can read you e-mail from ruby.

- receive e-mail – Net::POP3
- send e-mail – Net::SMTP
- create (before sending) and parse e-mail (from file, after receiving) – TMail

Net::POP3 and Net::SMTP are included in Ruby. TMail needs installation. I had a problem with TMail installation, and I contacted author. He recommended this procedure, and now it works.

ruby setup.rb config --without-ext
ruby setup.rb setup
ruby setup.rb install

Written by Željko Filipin

October 12th, 2006 at 9:09 pm

Posted in E-mail

2 Responses to 'Test If Application Sends Correct E-mails'

Subscribe to comments with RSS or TrackBack to 'Test If Application Sends Correct E-mails'.

  1. Testing E-mail: Tools

    Lately I have been testing e-mail functionality of one application. In the beginning I though that I would write two or three posts about that experience. Now I think there will be more, but not much more. I prefer more shorter articles that two or thr…

  2. [...] have been using TMail for testing e-mail functionality of web application that I test for a long time. But, development of that library stopped at 2004. Today I found out that it is again in [...]

Leave a Reply