sending file my email

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

sending file my email

Post by bobby »

hi,
i have an execl file which i load then i send to client for test data , can i automate that as soon as the job complete it automtically get emailed to them , i mean any automatic process i can do.
thanks
bobby
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Re: sending file my email

Post by vcannadevula »

bobby wrote:hi,
i have an execl file which i load then i send to client for test data , can i automate that as soon as the job complete it automtically get emailed to them , i mean any automatic process i can do.
thanks
bobby

Once the job for load is complete you can use the after routine to execute a shell script to mail the file to the specified person. use the MailX command for sending the mail with an attachment.

If you are sending a mail to just let them know the loaded file is there, then Use Notification activity.
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post by bobby »

Hi,
I want to send that file so u mean routine activity i should use , can u advise wht routine name as i have not seen any mail in there
thanks
bobby
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Post by vcannadevula »

bobby wrote:Hi,
I want to send that file so u mean routine activity i should use , can u advise wht routine name as i have not seen any mail in there
thanks
bobby

if you want to send the file as an attachement, call the shell script from the routine activity or from after subroutine.

In the shellscript write the MailX command
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You need to use sendmail routine.
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Post by vcannadevula »

vcannadevula wrote:
bobby wrote:Hi,
I want to send that file so u mean routine activity i should use , can u advise wht routine name as i have not seen any mail in there
thanks
bobby

if you want to send the file as an attachement, call the shell script from the routine activity or from after subroutine.

In the shellscript write the MailX command

Use the ExecSH
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Post by vcannadevula »

Sainath.Srinivasan wrote:You need to use sendmail routine.

SendMail routine will not handle the Attachment. So, use the shell script to do that.
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post by bobby »

sri
u said DSsend in valueexpression should i give path of tht file
thanks
bobby
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

sendmail is an Unix command that you can use to send with attachment. This is the underlying command called by dssendmail routine.
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post by bobby »

hi
i did this ,its not working i went to EXECSH and in input i wrote

$mail bobby@express.com</datastage01/nin/Act_Sub.csv
thanks
bobby
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Does that work from command prompt?
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Post by vcannadevula »

bobby wrote:hi
i did this ,its not working i went to EXECSH and in input i wrote

$mail bobby@express.com</datastage01/nin/Act_Sub.csv
thanks
bobby


mailx -s "ur subject" -c 'any CC address' 'TO address' < /tmp/email.msg


Use the above command. The last part is the path of the file you want to attach and email.msg is the file being attached here in this example which is located in /tmp folder.
bobby
Participant
Posts: 86
Joined: Mon Jul 19, 2004 8:31 pm

Post by bobby »

this command give me whole body of excel file i want attachment
$mail bobby@express.com</datastage01/nin/Act_Sub.csv
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Post by vcannadevula »

bobby wrote:this command give me whole body of excel file i want attachment
$mail bobby@express.com</datastage01/nin/Act_Sub.csv

cat /datastage01/nin/Act_Sub.csv >> /tmp/email.msg
mailx -s "$SUBJECT" -c $CCADDRESS $TOADDRESS < /tmp/email.msg
Post Reply