Email with Attachment
Posted: Tue Mar 27, 2018 2:31 am
I hope this is an easy solution.
I want to send an email with attachment from the iSeries:
Here's what I have
It passes these above parameters to this function that runs on the iSeries:
My problem is this: The field #EMAILRTNM is the file location & name of the report I want to attach to my email. The location I have in the above code is an IFS directory. The email sends but without the attachment. What am I doing wrong?
Best,
Chad
I want to send an email with attachment from the iSeries:
Here's what I have
Code: Select all
#EMAILTO := 'lawingo@sherrillfurniture.com'
#EMAILFROM := 'SMTP:lawingo@sherrillfurniture.com'
#EMAILSBJ := 'Test Report'
#EMAILMSG := 'tEST rEPORT'
#EMAILRTNM := '/emaildocs/CHAD.PDF'
Code: Select all
Use Builtin(MAIL_START) To_Get(#FW_RETCD)
Use Builtin(MAIL_SET_SUBJECT) With_Args(#EMAILSBJ) To_Get(#FW_RETCD)
Use Builtin(MAIL_ADD_ORIGINATOR) With_Args(#EMAILFROM) To_Get(#FW_RETCD)
Use Builtin(MAIL_ADD_RECIPIENT) With_Args(TO #EMAILTO) To_Get(#FW_RETCD)
Use Builtin(MAIL_ADD_TEXT) With_Args(#EMAILMSG) To_Get(#FW_RETCD)
If Cond(#EMAILRTNM <> ' ')
Use Builtin(MAIL_ADD_ATTACHMENT) With_Args(#EMAILRTNM)
Endif
Use Builtin(MAIL_SEND) To_Get(#FW_RETCD)
Best,
Chad