KB Article 16366
2020/01/20

Close
X
Contact Tech Support

 Email Tech Support
 (250) 655-1766
 [7:30 - 5:00 PST]
Your Meeting ID will be Provided by a Rep.
Tech Support
Tech Support Home
Software Updates
Knowledge Base Search
Recent KB Articles
Product FAQs
Code Samples
Documentation
Tech Blog
System Requirements
Installation Instructions
Support Testimonials
Contact us to...
Create a Ticket
Request a Free Demo
Suggest a New Feature
Submit Feedback
Upload a Large File
Other Services
Software Training
Professional Services

Unable to send mail with sendmailex()? Here's how to confirm whether it's due to WebSmart or the IBM i's connection to the mail server.

Product: WebSmart ILE Type: How to

When you change to a new mail server, WebSmart will no longer be able to send emails with sendmailex() until you update the IP address and domain from ECFGSMTP. To do this, you can add XL_WEBSPT to your library list and then prompt ECFGSMTP with F4.

Even if the information in ECFGSMTP is correct, you may still receive errors when sending emails through WebSmart. One such error is "550 5.7.1 unable to relay". This is an error returned from the mail server, and generally means that the email is successfully generated and sent by WebSmart but is being stopped by something else on your network. The best way to confirm whether or not this is the case is to send an email from the IBM i itself, with telnet.

You can run these commands from the IBM i to connect to and send an email from a Microsoft Exchange server:

TELNET RMTSYS(<mail server IP>) PORT(25)
EHLO <domain you're connecting from>
MAIL FROM: <from address>
RCPT TO: <to address>
DATA
Subject: Test email
This is a test message.
.
QUIT

The mail server will respond with instructions on how to terminate your message. For Exchange servers, you generally need to end the message with a period on a separate line. Once the message has been terminated, the email will either be sent or you will receive an error. If you receive the same error that you see in WebSmart, then you will need to troubleshoot your network connection, as it's possible that the mail server or is not configured to accept requests from your IBM i.

More information on how to do this (as well as an example with the commands being used) can be found in Microsoft's documentation: https://docs.microsoft.com/en-us/exchange/mail-flow/test-smtp-with-telnet?view=exchserver-2019

 

 

Rate This Article

Did this example help you to achieve your goal?
 Yes  No  Don't Know

Enter additional comments below.   If you want to hear back from us, include your contact information.

Email Address:
Comments:
Please enable JavaScript in order to rate this page.