ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to send .xlsx( not .csv) file as email from AS400

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to send .xlsx( not .csv) file as email from AS400

    I am looking specifically for .xlsx because I dont want the leading zeros to get truncated in one column. If copy the file to stream with ..csv extension, and use SNDSMTPEMM command to send the file, I am receiving it but with leading zeros truncated. I tried to copy with .xlsx extension, but I am not sure what change I have to make in the SNDSMTPEM command.

    Below is the command I use to send .csv file.

    SBMJOB CMD(SNDSMTPEMM RCP((NISHA.RADHAKUMARI@BROADRIDGE.COM *PRI)) SUBJECT
    ('XXXXXX') NOTE(' Please see the report ') ATTACH(('/Fldr/XXX/
    2023-05-19-17.07.38RptName_Extract.csv' *EXCEL)) CONTENT(*HTML)) JOBD(XXXXJob)
    JOBQ(XXX) USER(XXXX)

    Please help me to know what changed I have to make in the command to send ​/Fldr/XXX/
    2023-05-19-17.07.38RptName_Extract.xlsx file?

  • #2
    First of all, you need software that creates the file in .xlsx format Do you have that? Note that simply renaming the file to end in .xlsx isn't going to help -- the data will still be in CSV format, since renaming only changes the name, it doesn't change the format of the document.

    So find software that creates the file in Excel format. Once you have that, attach the .xlsx file instead of the .csv file. (The email part is the easy part!)

    Comment

    Working...
    X