Testing SAP SMTP service
Considering you have set up the SAP SMTP service as described in this document: Configuring SAP SMTP service. An important step is to know if the service is working. Testing the outbound process is easy and straight forward: it’s just sending an email and check if the receiver receives it. That’s too easy to be discussed here. On the other side, sending emails to the SAP SMTP server (or: receiving) is not so easy and can be even more crucial. The first question here of course is: how to send an email to SAP SMTP?
You can simulate receiving emails using a transaction. SOIN allows to simulate receiving an email, but does this really simulates / tests the flow of the message: receiving an email from another computer on port 25[nnn]? What about having an external system actually having send an email? How can you simulate this? You can of course set up a complete mail infrastructure and let a real SMTP server forward emails to SAP, but that’s not really easy and you’ll end up having to configure somewhat more than just your SAP system. Setting up the whole mail route can take time and is not always possible. This means also using for instance Outlook won’t be possible.
You can use telnet to talk to an SMTP server. You know how to do this, right? After all, that’s how you actually send every day your emails (and people wonder why you are not responding to every email).
telnet sapserver 25000
MAIL FROM: firstname.lastname@example.org
RCPT TO: email@example.com
354 Enter mail, end with “.”
Subject: test mail
Look, I can talk with my SMTP server
Connection to host lost.
Checking inside SAP if the email was received
- Sending email via telnet
- Testing your SMTP server
- Doing it the most boring and troublesome way
While the geek factor of sending emails via telnet is at the same level as 20 years ago – only the perception changed from: you are a hacker to: what are you doing, never heard of Outlook? – it is not really usable to reliably test a SMTP server. And it is slow. Not to mention that sending an attachment complicates everything. And you cannot load test your server.
A good, free, fast and easy to use tool to test SMTP is jMeter. jMeter can not only be used for testing web applications , , but also for other applications. SMTP is one of those. I`ll treat this in the next blog.
 Record Web Dynpro Java tests with jMeter