Question & Answer
Question
How To Customize The FROM E-Mail Address When Sending E-Mail From Your IBM i Server?
Answer
For IBM i 7.1 and earlier, refer to the *SDD section on how to customize your FROM e-mail address.
At IBM i 7.2 and later, the method for customizing the FROM e-mail address when sending e-mail from your IBM i server differs based what directory type is configured in the IBM i SMTP Attributes. As a result, you need to identify the E-mail Directory Type configured in your IBM i SMTP Attributes first.
- Enter the CHGSMTPA CL command and press F4 to prompt the command.
NOTE: You must be signed on with a user profile that has *IOSYSCFG special authority in order to use this command.
- Locate the "E-mail directory type" parameter and identify the current value.
*SMTP OR *SMTPMSF
1) Ensure PTF 5770TC1-SI57660 is applied if you are running IBM i 7.2 OS.
2) Prompt the CHGSMTPA command with a F4 to change your SMTP attributes.
3) Configure the "SMTP domain alias" (ALIASDMN) attribute to the e-mail domains you wish to use on your FROM e-mail addresses.
- Example: CHGSMTPA ALIASDMN('US.IBM.COM' 'CN.IBM.COM')
In addition, the IBM i SMTP Server will now accept e-mails with the e-mail domain of US.IBM.COM and CN.IBM.COM.
E-mails sent from the IBM i will be delivered locally when the FROM and TO e-mail domains match one of the domains set on the ALIASDMN attribute.
- Example: FROM: [email protected] TO: [email protected]

4) If a SMTP user does not exist for the IBM i user profile, execution of the ADDUSRSMTP command or WRKSMTPUSR Option 1 to "Add a User" is required. If a SMTP user already exists, execution of the CHGUSRSMTP command or WRKSMTPUSR Option 2 to "Change a User" is required.
- Example: ADDUSRSMTP USRPRF(as400) ALIAS(as400) DOMAIN(001 *DFT)
The value of the domain index (001, 002, etc.) is determined by the order of the domains specified on CHGSMTPA ALIASDMN().
- Example: CHGSMTPA ALIASDMN('US.IBM.COM' 'CN.IBM.COM')
ADDUSRSMTP USRPRF(as400) ALIAS(as400) DOMAIN(002 *DFT) = This will set a SMTP alias of "[email protected]" as the user's FROM e-mail address since the domain index 002 equates to CN.IBM.COM.

5) Execute the command WRKSMTPUSR Option 5 to work with your SMTP users and verify the alias e-mail address configured.

6) All of the changes are dynamic and take affect immediately. A restart of the SMTP Server is NOT required.
*SDD
1) Execute the WRKDIRE CL command to work with directory entries.
2) Locate the user ID in the list you wish to customize the FROM e-mail address for.
3) Enter option 2 next to the user ID to change the directory entry.
4) Press F19 to change the name for SMTP. NOTE: You might have to press ENTER if you are setting up a SMTP name for the first time.
5) Set the SMTP user ID and domain to your desired values to construct the FROM e-mail address.
SMTP user ID = the user information specified to the left of the @ symbol.
SMTP domain = the e-mail domain specific to the right of the @ symbol.
These values will customize the FROM e-mail address to "[email protected]" when sending email under the directory entry user ID.

6) Press ENTER twice to save the SMTP name and directory entry changes. With the above configuration, any e-mails sent by the AS400 user profile will have a FROM e-mail address equal to the <SMTP user ID>@<SMTP domain> value, which happens to be "[email protected]" in this example.
7) All of the changes are dynamic and take affect immediately. A restart of the SMTP Server is NOT required.
Was this topic helpful?
Document Information
Modified date:
03 November 2021
UID
nas8N1021063