Sending mail from IBM I

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
kno_dk
Posts: 89
Joined: Tue Feb 23, 2016 12:00 am

Sending mail from IBM I

Post by kno_dk » Thu Aug 23, 2018 7:14 pm

Hi

I have a Lansa function sending mail (like this https://docs.lansa.com/14/en/lansa008/c ... f526184311) from the IBM I using msf/SMTP.

It works when I send to an GMAIL account, but if I send to any other mail account it never arrive.

I have looked at differnt descriptions regarding the setup(like this http://www.keoform.com/emailsu.pdf) and every thing look correct.

Is there anybody who have hade the same issues or is an expert in mail setup on IBM I that can help solving this issue?

Thanks

/Klaus

PierreLefrancois
Posts: 20
Joined: Wed Nov 09, 2016 3:02 am

Re: Sending mail from IBM I

Post by PierreLefrancois » Thu Aug 23, 2018 10:34 pm

Hello,

The first place I would look is the QZMF journal. See if there any hints to a "bounce back / return to sender" type message.

To have email entries in the QZMF journal, you must have JOURNAL(*YES) on the CHGSMTPA command.

The best way to display that journal is to dump it in a temporary table like so:

DSPJRN JRN(QZMF) RCVRNG(*CURCHAIN) OUTPUT(*OUTFILE) OUTFILE(QTEMP/MAIL_LOG) ENTDTALEN(*CALC)
and then
RUNQRY *N QTEMP/MAIL_LOG

Now, analyzing this log is not the most fun thing to do....But maybe look for an entry like "83 U <your_recipient_email_addresss>" in column named "SPECIFIC DATA". This might lead you to the cause of the problem.

Refer to https://www.ibm.com/support/knowledgece ... ournal.htm for a complete list of journal entry codes.

Troubleshooting emails on the i can be difficult ....good luck.

Pierre

atostaine
Posts: 395
Joined: Wed Jan 20, 2016 7:38 am

Re: Sending mail from IBM I

Post by atostaine » Fri Aug 24, 2018 1:14 am

Have you checked blacklists out there to see if your IP is tagged? There have been many discussions on the lists @ midrange.com about setting up SMTP to work reliably on IBM i.

There are so many settings that have to be perfect or your i will get blacklisted the first time you send an email.

I am with Pierre. Good Luck.

Art
Art Tostaine

User avatar
lawingo
Posts: 50
Joined: Fri Dec 04, 2015 6:41 am

Re: Sending mail from IBM I

Post by lawingo » Thu Aug 30, 2018 10:58 pm

I use the "SNDSMTPEMM" utility to send email from the AS400. I have a RP that builds a command string, for example:

Code: Select all

 #W_CMD := 'SNDSMTPEMM RCP((' + #EMAILTO + ')) SUBJECT(' + "'" + #emailsbj + "'" + ') NOTE(' + "'" + #emailmsg + "'" + ') ATTACH((' + "'" + #EMAILRTNM + "'" + ' *PDF))'
 Exchange Fields(#W_CMD)
Use Builtin(CALL_SERVER_FUNCTION) With_Args(*SSERVER_SSN SHAPSVC Y Y) To_Get(#FW_RETCD)
The SHAPSVC function Executes an iSeries Command:

Code: Select all

EXEC_OS400 COMMAND('#W_CMD') IF_ERROR(E1)
You will need to make sure the user sending the email is authorized: go TCPADM > #2 "Configure TCP/IP applications > #12 Configure SMTP > #1 > Work with System Alias Table

* NOTE - If I need to send an attachment I generate the attachment and copy it to the IFS and the appropriate variable in my command line holds the location for that attachment. Sending from the IFS was the only way I could get it to send an attachment. I also delete the file in the IFS as a clean up measure once the email is sent.

Best,
Chad
Sherrill Furniture Company

Post Reply