![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxAuDcOaq44hI2uMgIOK5spl2ReWCx9nLomG9deHMSRqJnga2EW4cREOACtHpKukI5YHWfjp3t5ekHGBPVYmAzsTVS8KQ1CWEo3z3rdvNv9akI-7FO1psJkWE3r94hVFQg9nxqpXYaobte1b5lAn59OZyZZzoZ-MIUj8jcD2pOq4_66MDgP_DawvS4Xqs/s200/sql.png)
We have been able to send email from our IBM i partitions for several releases, using IBM commands and various third party tools. I use the Send SMTP Email command, SNDSMTPEMM, that comes within the IBM i operating system. Within the latest round of Technology Refreshes, IBM i 7.5 TR3 and 7.4 TR9, comes another way, with SQL.
A new scalar function was added to the SYSTOOLS library called SEND_EMAIL. It has four parameters:
- TO_EMAIL: Recipients email address. Mandatory
- SUBJECT: Email's subject line. Mandatory
- BODY: Email's body. Mandatory
- ATTACHMENT: IFS path name of the file to be sent as an attachment. Optional, if omitted no attachment is sent
For example: