Page 1 of 1

Sending mail from IBM I

Posted: Thu Aug 23, 2018 7:14 pm
by kno_dk
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

Re: Sending mail from IBM I

Posted: Thu Aug 23, 2018 10:34 pm
by PierreLefrancois
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

Re: Sending mail from IBM I

Posted: Fri Aug 24, 2018 1:14 am
by atostaine
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

Re: Sending mail from IBM I

Posted: Thu Aug 30, 2018 10:58 pm
by lawingo
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