Page 1 of 1

DSSendMail 'To:' Parameter Question

Posted: Wed Sep 13, 2006 12:25 pm
by jshurak
I have the following piece of code setup to read the 'DSSendMail 'To:' parameter from the TEST_Email_Control.txt file. The contents of said file are: To:abc@xyz.com\n

My question is: Can you designate multiple email addresses in the 'To:' parameter?

Code: Select all


EMail = ''
* Find out what AS/400 the file will be extracted from ***
OpenSeq "G:\DataStage\DStage_Data\TEST_Email_Control.txt" To INLINE Then
Read: 
    ReadSeq DataLine from INLINE Then
       EMail = DataLine
    END
CloseSeq INLINE

****CALL DSExecute("NT", "type G:\DataStage\DStage_Data\TEST_Email_Control.txt", EMail, ReturnCode)


*** Variable Definition ***
message = ""
sender = "From:Data_Staqe_Dwetl2@appliedcard.com\n"
DateDay = OConv(@DATE - 1, "D-YMD[4,2,2]")

*** Process ***
message ="Subject: DWETL2 - ROW Extract CD623A":" \n "
message = message:"Server:172.17.90.80\n"
message = message:"Body:\n"
message = message:"Command Center, \n"
message = message:" \n"
message = message:"Production job Main_CD623A_Extraction has not run yet. Please make sure":" \n "
message = message:"the ROW extract for CD623A had been placed on":" \n "
message = message:"Server Dwetl2."
message = message:" \n"
message = message:" \n"
message = message:" \n"
message = message:"Thank you,":"\n"
message = message:"Dwetl2":"\n"
message = message:"ETL Production Server"

*
* Send the e-mail's
*

Call DSLogInfo(EMail,'Job Control')

    EMailMessage = ""
    EMailMessage = sender
    EMailMessage = EMailMessage:EMail
    EMailMessage = EMailMessage:message
    Call DSLogInfo(EMailMessage, 'Job Control')
    code = ''
    code = DSSendMail(EMailMessage)
    If code = 0 Then
       Call DSLogInfo("E-mail sent successfully.",'Job Control')
    End Else
       Call DSLogInfo("E-mail NOT sent.",'Job Control')
    End

Re: DSSendMail 'To:' Parameter Question

Posted: Wed Sep 13, 2006 12:43 pm
by DeepakCorning
As far as I know, nope. I tested it with many addresses seperated my commas/semi colons and all but it does not work. So I had to do include the code it many times to mail to many people.

Posted: Wed Sep 13, 2006 12:47 pm
by DSguru2B
Did you try with spaces in between?

Posted: Wed Sep 13, 2006 12:48 pm
by kris007
Spaces should work. I have done that in the past successfully :wink:

Another suggestion to overcome this would be to create a group email address and include all the people in it and use it rather than entering invidually unless it doesn't meet your purpose.

Posted: Wed Sep 13, 2006 1:16 pm
by DeepakCorning
Really ?? Is it possible in the Notification Activity Stage as well?? As I m trying with spaces and my ends up with a warning..

Posted: Wed Sep 13, 2006 1:25 pm
by DSguru2B
Yes, it surely works in the Notification activity. Have done that before successfully.

Posted: Wed Sep 13, 2006 1:32 pm
by DeepakCorning
Awesome It worked...Thanks Guru.

Posted: Wed Sep 13, 2006 3:09 pm
by ray.wurlod
You can always send to an email address that is a "list" in your email server.