IBM i Global

 View Only

 Sending Email with sender

Katia da Silva Adriano's profile image
Katia da Silva Adriano posted Tue March 31, 2026 04:06 AM

Thank you for all responses.

They are very useful.

Hello all,

We would like to have a command which has as parameter 'Sender'.  IBMi commands don't provide it.

SNDSMTPEMM RCP((&P#MAIL)) 

SUBJECT(&SUBJECT) 

NOTE(&NOTE) +   

   ATTACH((&OBJLNK *EXCEL *TXT))       

The workaround in case of the command above is to have all senders in the directory entry but it's is error sensitive.

How did you solve this issue?

Thank you in advance.

Paul Nicolay's profile image
Paul Nicolay

The QtmmSendMail API offers you all flexibility... but you need to code something around it.

Robert Berendt's profile image
Robert Berendt IBM Champion

A few decades back Dave Leland wrote an article for News/400.  He basically wrote a command wrapper for the QtmmSendMail API.  We still use it, somewhat modified.  Yes, you can customize the sender.  Try WRKOBJ *ALL/SNDEMAIL to see if someone installed it on your system at some time.

I checked out SEND_EMAIL scalar function - IBM Documentation but that uses the same command you're having issues with.

There's also a gentlemen called Brad Stone who peddles an email product for IBM i.  Never looked at it but there are a lot of references that it's inexpensive and effective.

Paul Nicolay's profile image
Paul Nicolay

Now that Robert mentioned a commercial product I will take the liberty to link to https://systemsi.cegeka.com as well.

We do offer an SMTP toolkit for easy integration in existing (RPG) programs.

Bradley Stone's profile image
Bradley Stone

You can check out MAILTOOL at https://www.bvstools.com/mailtool.  It will do what you want and a lot more.  If you wish to keep using SNDSMTPEMM you can use MAILTOOL to override the workings in the background and set up a config file to specify a sender/FROM address.  See:

https://fieldexit.com/forum/display?threadid=907

Feel free to contact me with any questions.  MAILTOOL is over 30 years old and used by thousands of shops all over the world.  When most email providers go to OAuth 2.0 it's also scalable for that too, unlike the IBM commands.

Rich Malloy's profile image
Rich Malloy IBM Champion

We use a commercial product for most things, however, there are times where we use the SNDSMTPEMM command. One thing you could consider (if you haven't already) is what your SMTP Attributes are set to for the "email directory type". I think by default, its set to SDD which is the System Distribution Directory , but you also have the option of setting that to *SMTP. If set to *SMTP, you then use the ADDUSRSMTP command to add your users into it and in there, you can specify what the originator email address should be. While not perfect by any means, maybe its something worth exploring if you want to avoid commercial / open source utilities. 

Rudi Van Helvoirt's profile image
Rudi Van Helvoirt IBM Champion

Hello Katia,

It is fair to say that you have a point. Not being able to specify a sender address when mailing from IBM i with that CL command is something more people will appreciate and more important will start using.

So for that reason I created an IBM idea https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-4869

The more people vote for it the more likely IBM will consider adding this option. So please vote for it.