IBM Support

How To Customize The FROM E-Mail Address When Sending E-Mail From Your IBM i Server

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')
The US.IBM.COM and CN.IBM.COM e-mail domains can now be configured for SMTP users as their FROM e-mail domain.
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: as400@us.ibm.com TO: as400@us.ibm.com
While logged in as the AS400 user profile, I executed the command, SNDSMTPEMM RCP((as400@us.ibm.com)) SUBJECT(TEST) NOTE(TEST) - This e-mail will be delivered locally since the from and to e-mail addresses are identical.  If you want this scenario to flow through your Forwarding Mailhub Server, you will need to implement the QIBM_SMTP_FWDSVR_LCL_MAIL=YES environment variable as discussed in the URL, https://www-01.ibm.com/support/docview.wss?uid=nas8N1010638.

Screen shot of the CHGSMTPA command and SMTP domain alias parameter.


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)
This will set a SMTP alias of "as400@US.IBM.COM" as the user's FROM e-mail address since the domain index 001 equates to US.IBM.COM in the SMTP attribute "SMTP domain alias (ALIASDMN)".
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')
Domain index 001 = US.IBM.COM and index 002 = CN.IBM.COM
ADDUSRSMTP USRPRF(as400) ALIAS(as400) DOMAIN(002 *DFT) = This will set a SMTP alias of "as400@CN.IBM.COM" as the user's FROM e-mail address since the domain index 002 equates to CN.IBM.COM.

Screen shot of the ADDUSRSMTP command parameters.


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

Screen shot of the WRKSMTPUSR Option 5 to display the SMTP User configuration.
With the above configuration, any e-mails sent by the AS400 user profile will have a FROM e-mail address equal to the "Alias E-mail Address" value, which happens to be "AS400@CN.IBM.COM" in this example.

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.

Example: SMTP user ID = as400; SMTP domain = us.ibm.com
These values will customize the FROM e-mail address to "as400@us.ibm.com" 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 "AS400@US.IBM.COM" in this example.

7) All of the changes are dynamic and take affect immediately. A restart of the SMTP Server is NOT required.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"SMTP Client","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
03 November 2021

UID

nas8N1021063