AS400 SNDDST with Dynamic from address

130 pts.
Tags:
AS/400
dynamic controls
SNDDST
kindly anyone please tell me, how to change dynamic FROM email address in the SNDDST command.I have task to change the from address in the SNDDST based on parameter user sent.I checked in the internet with option to configure TCP using WRKDIRE.But i want the dynamic from address for the particular module only.

Answer Wiki

Thanks. We'll let you know when a new response is added.

From:

http://search400.techtarget.com/news/968106/Activate-SMTP-service-on-the-iSeries-system-to-send-e-mails

Activate SMTP service on the iSeries system to send e-mails. Your iSeries system can be used to send e-mails to your e-mail server. To do this using the Send Distribution (SNDDST) command, follow this procedure. The sender of the e-mails must be a local SNADS user.

1. Enter command CFGTCP
2. Choose option “20. Configure TCP/IP applications”
3. Choose option “12. Configure SMTP”
4. Choose option “3. Change SMTP attributes”
5. Set value “Autostart server . . . . . . . . *YES”

Automatic registration . . . . . *NO
User ID prefix . . . . . . . . QSM
Address . . . . . . . . . . . QSMRMTAD
System name . . . . . . . . TCPIP
Alias table type . . . . . . . *SYSTEM
Mail router . . . . . . . . . . ‘mymailserver@company.com’

(‘mymailserver@company.com’ is the DNS name of your mail server, please check first locally which DNS name and TCP/IP address you’ll have to use.)

The local mail server DNS name and IP Address has in any case to be added into the local iSeries 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 111.11.111.111 with Host

Name ‘mymailserver@company.com’

6. Add following 2 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)

7. For each DIRE user you want to send an e-mail to, change his entry using command (here an example for my own profile on system BASLE.)

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

8. Use command CHGTCPDMN to set
* HOSTNAME to BASEL (BASEL is an example; enter your system name here.)
* DMNNAME to company.com (company.com is an example; enter here your company domain name.)

To send an e-mail use the following command:

SNDDST TYPE(*MSG)
TOUSRID((USERNAME BASEL))
z DSTD(‘Description text’)
MSG(‘Message text’)

To send e-mails to users not defined in WRKDIRE change once the Distribution Attributes 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((‘reciepient 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)
* STRTCPSVR SERVER(*SMTP)

Now Use *current (Default) in USRID Parameter

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • NickHutcheson1
    This might help. Prompt the command, F9, F11. Roll to ... User identifier: USRID User ID . . . . . . . . . . . *CURRENT Address . . . . . . . . . . . User identifier (USRID) - Help Specifies which user ID and user ID address should be associated with the request. *CURRENT You are performing the request for yourself. user-ID Specify another user's user ID or your user ID. You must have been given permission to work on behalf of another user or have *ALLOBJ authority. user-ID-address Specify another user's address or your address. You must have been given permission to work on behalf of another user or have *ALLOBJ authority. You can easily test this with SNDDST TYPE(*LMSG) TOINTNET((YourEmailAdress.blah.COM)) DSTD('THIS IS A TEST FROM THE ISERIES') LONGMSG(MSG) USRID(alternatename)
    1,380 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following