Archive for January, 2007
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 three longer ones. I am all about little steps, as you will shortly see.
This is the third article. Last week I wrote a little introduction and how to install SMTP server.
As I wrote the last year, when testing e-mail, I am using Ruby and this Ruby libraries:
Testing E-mail: Introduction
Lately I have been testing e-mail functionality of one application. I will post my experience in two or three articles. This is the second one. Yesterday I blogged about how to install SMTP server.
Testing is lots of fun. You do something, see what your application does and decide if it is correct behaviour.
Testing e-mail functionality of web applications is lots of fun, too. Also, it can be very time consuming.
Say, for example, you start a discussion at a forum. After discussion is started, forum members receive e-mail saying that new message is started. You could get the same e-mail, or just a confirmation e-mail saying that your contribution was successful. Some members maybe do not receive e-mails immediately after discussion is added, but receive a digest. Every 5, 10, 20 messages; daily, weekly, monthly digest. Some decided that they do not want any e-mail notification.
Another functionality of that forum could be that it receives e-mail. When member of forum sends an e-mail to forums e-mail address, discussion is started, it is visible at web interface, and members of forum receive e-mail notification, regarding of their preferences.
You can test all that. The boring part is waiting… and waiting… more waiting… and some more waiting. You get the point.
If you have Gmail account, you can use it for testing. If you have Gmail address username@gmail.com, just add +something between username and @gmail.com. Like this username+something@gmail.com. Anything you sent to that address will end up in your inbox. That way you can use one account for multiple users.
I would recommend that just for quick test. In my experience, sent e-mail will be delivered somewhere between a few seconds and a few hours. Rarely, even a few days. And the waiting part was really a problem to me.
There is a quicker way:
- Sending e-mail: install SMTP Server at your machine.
- Receiving e-mail (manual): set up application in a way that all mail is delivered to a folder at the same server were web application is, so you can quickly check it (no delays).
- Receiving e-mail (automated): set up POP3 server that will get all mail from that folder.
I do not know how to do that set up, I was lucky enough to have a developer who did it for me.
I will provide more details on automated testing of e-mail functionality in the next post.
Testing E-mail: Install SMTP Server
I will be writing about testing e-mail functionality of web applications in the next post or two. If you are serious about testing e-mail functionality, the first step is to install SMTP server at your machine. This is tested on Windows XP Professional, service pack 2. You will need Windows operating system CD.
Make sure you are logged in as administrator, or start Add or Remove Programs as administrator:
- go to Control Panel
- highlight Add or Remove Programs
- hold Shift key at keyboard
- press right mouse key
- select Run as…
- select administrator account
- enter password if necessary
- press button OK
At Add or Remove Programs:
- click Add/Remove Windows Components
- select Internet Information Services (IIS)
- click Details…
- check SMTP service check box
- Common Files, Internet Information Services Snap-in and World Wide Web Service will automatically select
- do not deselect anything
- finish installation
- you will be prompted to insert Windows operating system CD
I am using Ruby’s Net::SMTP library for sending e-mail. I tried to send an e-mail and got this exception:
Exception: 550 5.7.1 Unable to relay for community@site
You need to change a setting or two:
- go to Internet Information Services (in Administrative Tools)
- right click Default SMTP Virtual Server
- click Properties
- select Access tab (second from the left)
- click button Relay… (bottom right)
- select Only the list below radio button
- click button Add…
- add 127.0.0.1
Many thanks to my developer who helped me to install and adjust my SMTP server.
