#1  
Old 03-21-2006, 08:37 AM
wolf wolf is offline
Member
 
Join Date: Mar 2006
Posts: 27
Sending an email with the AS400

Hello,

i am a newbie and i wish to know how to send a simple email.
I type the commande SNDDST but it seems complexe to me ; i want simply send a text message to a client or someone else.

Thanks in advance for help.

Wolf
Reply With Quote
  #2  
Old 03-21-2006, 09:06 AM
zreclay's Avatar
zreclay zreclay is offline
Member
 
Join Date: Sep 2005
Location: Raleigh, NC, USA
Posts: 578
Here is a simple cheatsheet that I created a long time ago. I think it is still applicable. Copy/paste the text into your word processor and it will be easier to read.

Code:
How to send email from iSeries

I.	Simple message

You will need to know the internet address(es) of the recipient(s).  Use the SNDDST command to send the message.

Parameters:
1.	TYPE:		Use *LMSG (Long Message, 5000 characters maximum)
2.	TOINTNET:	The internet address of the recipient.  Use the “+” for additional addresses. 
 
	Recipient Type is  
		*PRI	for the TO addressee 
		*CC	for CC: addressees 
		*BCC	for BCC: addressees.

3.	DSTD:		This field contains the subject line of your message 
4.	LONGMSG:	The text of your message.  

Example:

	SNDDST	TYPE(*LMSG) TOINTNET((someone@SomeDomain.com) (someoneelse@hotmail.com *PRI)) 
	DSTD(Here is your file!!) LONGMSG(Your test worked great!.  Please call me if you have questions/comments.  )



II.	Send a file as an attachment

The file must exist in the QDLS directory structure.  You need to know the name of the file.
You will need to know the internet address(es) of the recipient(s).  Use the SNDDST command to send the message.

Parameters:
1.	TYPE:		Use *DOC (The document specified on the Document prompt (DOC parameter) 
			or the Document identifier prompt (DOCID parameter) is sent.  The user must 
			have authority for the document before it can be sent).
2.	TOINTNET:	The internet address of the recipient.  Use the “+” for additional addresses. 
 
			Recipient Type is  
				*PRI	for the TO addressee 
				*CC	for CC: addressees 
				*BCC	for BCC: addressees.

3.	DSTD:		This field contains the subject line of your message 
4.	MSG:		The text of your message (256 characters maximum).
5.	SNDFMT:		*NOCHG
6.	DOC:		The name of the document in 8.3 format, e.g., TESTMAIL.TXT, or whatever name exists in the QDLS folder.
7.	FLR:		The name of the folder in the QDLS directory, e.g., PCUPLOAD

Example:

			SNDDST	TYPE(*DOC) TOINTNET((someone@SomeDomain.com *PRI) (someoneelse@hotmail.com *PRI)) 
			DSTD(Here is your file!!) MSG(File TESTMAIL.txt attached) SNDFMT(*NOCHG) 
			DOC(TESTMAIL.TXT) FLR(PCUPLOAD)
For additional help on the SNDDST command, press F1 at the SNDDST screen.

HTH,
Robert
__________________
"Contrariwise, if it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic.''--Tweedledee

Last edited by zreclay; 03-21-2006 at 09:47 AM.
Reply With Quote
  #3  
Old 03-21-2006, 10:36 AM
wolf wolf is offline
Member
 
Join Date: Mar 2006
Posts: 27
sending an email with AS400

Thanks for your response but i have another problem ; when i execute the command , the system tell me that the user doesn't exist in the mailing list ; but i don't want to send a mail to a specific user but i want to send a mail to a friend or to a relative for example.

Is it a way to create a mailing list in AS400 , if yes , can you tell me how to do this ?

Thanks

Wolf
Reply With Quote
  #4  
Old 03-21-2006, 10:53 AM
zreclay's Avatar
zreclay zreclay is offline
Member
 
Join Date: Sep 2005
Location: Raleigh, NC, USA
Posts: 578
Sounds like you may need to have your system administrator configure the machine to allow for outside email. Someone else with have to chime in with advice for that. Sorry.

As far as the mailing list is concerned, IBM has a free utility called MMAIL that is great for just that purpose. Check out http://www-922.ibm.com/mmail/start. Your system administrator will have to help with the install if you decide it will work for you.

Robert
__________________
"Contrariwise, if it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic.''--Tweedledee
Reply With Quote
  #5  
Old 03-21-2006, 11:00 AM
wolf wolf is offline
Member
 
Join Date: Mar 2006
Posts: 27
sending mail with the AS400

I'am working with an AS400 who's dedicated to test : i can do what i want with it ; i have all rights (allobj , qsecoff ).
I'm not the administrator but i've got the same rights.

Is it complicate to configure the machine to allow outside mail ? If no , can you tell me how to do this if it's not too long ?

Thanks

Wolf , an AS400 newbie
Reply With Quote
  #6  
Old 03-21-2006, 11:49 AM
Scott Klement's Avatar
Scott Klement Scott Klement is offline
 
Join Date: Jul 2005
Location: Milwaukee, WI, USA
Posts: 10,576
First of all, you have to understand that the AS/400 supported E-mail long before the Internet came around, and SMTP became popular. It used an e-mail system called SNADS that IBM developed specifically for their business machines.

That's why commands like SNDDST seem so complicated. They weren't designed for today's Internet e-mail, they were designed for SNADS and later adapted for SMTP.

Before explaining how to set up e-mail, I'm making the following assumptions:
  • Your system is already configured for TCP/IP.
  • You already have DNS lookups working from your iSeries to Internet domains as well as local domains.
  • You have an Internet Service Provider (ISP) who has given you an outgoing mail server to relay your e-mail. Or you have an internal SMTP server that your company uses for e-mail.

The first thing you'll want to do is configure your iSeries SMTP server. This is used when sending mail as well as receiving it. Type the following command:

Code:
CHGSMTPA AUTOSTART(*YES) MAILROUTER('your.isp.smtp.server') FIREWALL(*YES) ALWRLY(*BOTH)
  • AUTOSTART(*YES) tells the system you want this server to start automatically when TCP/IP is started.
  • the MAILROUTER keyword tells where the iSeries should send outgoing e-mail to. This'll be the internal SMTP server that your company uses for mail, or the one that your ISP provided you.
  • The FIREWALL(*YES) keyword tells the iSeries to always send mail though the MAILROUTER, never try to deliver it directly.
  • ALWRLY(*BOTH) is used to configure who is allowed to send mail though this server. Do not set this to *ALL or spammers will be able to use your machine to send spam without your consent. With *BOTH, you'll have to use the ADDSMTPLE command to control which computers can use your SMTP server (more later).

You'll also want to make sure that e-mail messages are not split up, even if they're big. This has always seemed strange to me, but it's controlled by the CHGPOPA (Change POP3 Attributes) command.

Code:
CHGPOPA MSGSPLIT(*NOMAX)
As I mentioned above, you'll need to configure which IP addresses are allowed to send mail through your iSeries system. In my shop, all the computers who can send mail have IP addresses that begin with 192.168.5, so I run the following command:

Code:
ADDSMTPLE TYPE(*ACCEPT) INTNETADR('192.168.5.0') SUBNETMASK('255.255.255.0')
You can run this command more than once if you need to add more than one subnet.

The next thing you'll need to do is set up a gateway that allows SNADS tools like SNDDST to send Internet e-mail. To do that, type the following commands:

Code:
ADDDIRE USRID(INTERNET GATEWAY)   +
   USRD(‘Internet SMTP gateway’) SYSNAME(INTERNET)   +
   PREFADR(NETUSRID *IBM ATCONTXT)

CHGDSTA SMTPRTE(INTERNET GATEWAY)
After running this command, the SNDDST command will use the gateway so that e-mail will be sent to the local SMTP server.

Now that SMTP is configured on your system, so go ahead and start the SMTP server

Code:
STRTCPSVR SERVER(*SMTP)
(If it was already running, use ENDTCPSVR to end it. Then use WRKACTJOB SBS(QSYSWRK) to make sure that all of the QTSMTPxxxx jobs end, then use STRTCPSVR to start it up again.)

Each user who needs to send e-mail using SNDDST will need to have a directory entry and SMTP e-mail address configured on the iSeries.

Code:
ADDDIRE USRID(KLEMSCOT S10262BA) USRD('Scott Klement')
Code:
WRKNAMSMTP TBLTYPE(*SYSTEM)
  1. Use option 1=Add
  2. Type the same name/address that you used on the ADDDIRE command
  3. Enter the SMTP e-mail address for this user.

Once all of that is done, it should be easy to send off a test e-mail with SNDDST. For example:

Code:
SNDDST TYPE(*LMSG) +
       TOINTNET(('unclebob@example.com')) +
       DSTD('Put E-mail Subject Here') +
       LONGMSG('Hi Bob.  This is an E-mail message sent from my iSeries system.')
You should also be able to configure tools like Outlook, Firebird, Eudora, etc to send mail using your iSeries SMTP server. For user-written e-mail, that's nicer than using SNDDST. Though, SNDDST is still nice for automatic messages generated by programs.

There are also lots of free e-mail tools on the Web that can use this SMTP server. They provide many more capabilities than SNDDST does. But, alas, this message is getting too long, so I'll stop there.

Last edited by Scott Klement; 07-26-2006 at 01:49 AM.
Reply With Quote
  #7  
Old 09-20-2006, 08:45 AM
swelabada swelabada is offline
Member
 
Join Date: Aug 2006
Posts: 38
email s from AS400

I can send emails using SNDDST command .. But I can send only to my local domains only.. I cannot send it to yahoo.com or hotmail.com like emails. But if I use same system as the mail client which is lotus notes I can send emails to those ids.. To enable to send other than local domain are there any settings to be done in the system?

Last edited by swelabada; 09-20-2006 at 08:47 AM.
Reply With Quote
  #8  
Old 09-20-2006, 01:58 PM
Scott Klement's Avatar
Scott Klement Scott Klement is offline
 
Join Date: Jul 2005
Location: Milwaukee, WI, USA
Posts: 10,576
There are many different things that can prevent e-mail from working. What happens when you try to send to other domains? Do you get an error message? Do you get a bounce?

Understanding what part of the process is failing will help us lead you in the right direction.
Reply With Quote
  #9  
Old 09-28-2006, 03:38 AM
swelabada swelabada is offline
Member
 
Join Date: Aug 2006
Posts: 38
Email fro As400

Done.. My System administrator has blocked the lotus notes server to outside emails.. He gave me a differerent IP for out going mails .. Thank for your prompt support..
Reply With Quote
  #10  
Old 10-08-2006, 08:56 AM
swelabada swelabada is offline
Member
 
Join Date: Aug 2006
Posts: 38
AS400 emails

I have well configured the email sneds from as400. and It was working really well. But all of a sudden email sending was stoped. Nothing has been change and Still the SNDDST command says "Send distribution completed successfully".

I tried the same in the test as400 which is in the same LAN and its working perfectly. means no problum with the Lotus mail server.

Can you please guide me to where to check this ?

I even stop and start the SMTP server and still the problum is there.

I checked in "WRKDSTQ" and there are no pending entries in the QUEUE.

Status is like

MESADEV Normal : - : : 1 0 Not-Rdy

Where as Not-Rdy mode is common to test box which is working..

Pls guide..

Last edited by swelabada; 10-08-2006 at 09:03 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 04:39 AM.