Activate the SMTP service on your IBM i systems to send emails. Your IBM i system can be used to send emails to your email server. Follow the procedure below to do this using the Send Distribution (SNDDST) command. The sender of the emails must be a local SNADS user.
Enter the following command:
Choose option 20, Configure TCP/IP applications.
Choose option 12, Configure SMTP.
Choose option 3, Change SMTP attributes.
Set the following values:
Autostart server: *YES
Automatic registration: *NO
User ID prefix: QSM
System name: TCPIP
Alias table type: *SYSTEM
Mail router: '[email protected]'
'[email protected]' is the DNS name of your mail server; check first locally which DNS name and TCP/IP address you'll have to use.
The local mail server DNS name and IP Address must be added to the local AS/400 TCP/IP Host table using command CFGTCP and option 10, Work with TCP/IP host table entries. In our configuration we've added Internet address 126.96.36.199 with Host Name '[email protected]'.
Add the following two entries in the Directory Entries table:
ADDDIRE USRID(INTERNET GATEWAY) USRD('Context switching entry') SYSNAME(TCPIP) MSFSRVLVL(*USRIDX) PREFADR(NETUSRID *IBM ATCONTXT)
ADDDIRE USRID(QSMTPDMY QSMTPSYS) USRD('QSMTP user') SYSNAME(TCPIP) MSFSRVLVL(*USRIDX)
Note: See the note at the end of these steps. It contains instructions that you can use instead of following steps 7 and 8.
For each DIRE user you want to send email to, change their entry using the following command (the following is an example for a profile on system BASEL):
CHGDIRE USRID(USERNAME BASEL) USER(USERNAME) NETUSRID('USERNAME BASEL') USRDFNFLD((SMTPAUSRID SMTP 'firstname.lastname') (SMTPDMN SMTP 'company.com')) MSFSRVLVL(*SYSMS) PREFADR(*SMTP)
firstname.lastname is the part from your email address before the "@" character.
company.com is the part from your email address after the "@" character.
Use the command CHGTCPDMN to set:
* HOSTNAME to SYSTEMNAME (where SYSTEMNAME is the name of your system).
* DMNNAME to company.com (where company.com is your company domain name).
To send an email from the IBM i, use the following command:
SNDDST TYPE(*MSG) TOUSRID((USERNAME SYSTEMNAME)) DSTD('Description text') MSG('Message text')
To send emails to users that are not defined in WRKDIRE, change the Distribution Attributes once using this command:
CHGDSTA SMTPRTE(INTERNET GATEWAY)
Up to now, you can use following command (Information type has to be set to *LMSG) to send directly to an Internet address:
SNDDST TYPE(*LMSG) TOINTNET (('Recipient email address')) DSTD('Description text') MSG('Message text') LONGMSG('Long message text')
Be aware to stop and restart the SMTP Server using:
* ENDTCPSVR SERVER(*SMTP)
Note: INSTEAD OF STEPS 7 and 8 above, you can use the System Alias table (GO CFGTCP > 20. Configure TCP/IP Applications > 12. Configure SMTP > 1. Work with system alias table) and add an entry there (see below):
Instead of using escalation users and procedures, User Lists must be defined instead. See the section on User Lists in the latest QMessage Monitor IBM i User Guide (which is downloadable from the website).
The QUEUE column will need to have a special entry of *MAIL. The user and system name will be used as the address to send the distribution.
Once the User List has been defined it needs to be attached to the required Auto Reply records via the “Copy To” field.
Still have questions? We can help. Submit a case to Technical Support.