The Email service User's Guide
(http://staf.sourceforge.net/current/email.html) documents that you can
specify multiple TO and TEXTATTACHMENT options.

All of the binary/text attachments must reside on a single machine, so you
would need to use the FS COPY FILE request (via a <stafcmd>) to copy the
files to a single machine before submitting the <stafcmd> for the EMAIL
SEND request.

Thanks,
David


                                                                       
 David Bender          11501 Burnet Rd.   Phone (T/L): 1-512-286-5315  
 STAF/STAX Development Bldg. 903-5B002    (363-5315)                   
                       Austin, TX         ITN: 23635315                
 IBM Software Group,   78758-3400         Email: bda...@us.ibm.com     
 WPLC                                                                  
                                                                       
                                                                       






                                                                       
  From:       Cindy Zhu <c...@fekete.com>                              
                                                                       
  To:         David Bender/Austin/IBM@IBMUS                            
                                                                       
  Date:       03/15/2011 05:02 PM                                      
                                                                       
  Subject:    RE: [staf-users] Attachment                              
                                                                       





Hi David,

The request here only take care of single email address and single text
attachment.

I have multiple email addresses and multiple text attachments on different
machines. What should the request look like?

Thanks,

Cindy

From: David Bender [mailto:bda...@us.ibm.com]
Sent: March-11-11 2:06 PM
To: Cindy Zhu
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] Attachment



<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">

<stax>

  <script>
    from com.ibm.staf import STAFUtil
    emailTo = 'u...@company.com'
    emailSubject = 'This is the email subject'
    emailMessage = 'This is the email message'
    emailAttachmentMachine = 'attachmentMachine.domain.com' # Machine where
attachment files are located
    emailTextAttachment = 'C:/STAF/bin/STAF.cfg'
    emailBinaryAttachment = 'C:/temp/ia.bmp'
  </script>

  <defaultcall function="email_example"/>

  <function name="email_example">

    <sequence>

      <stafcmd name="'Sending email'">
        <location>'local'</location>
        <service>'EMAIL'</service>
        <request>
          'SEND TO %s SUBJECT %s MESSAGE %s ATTACHMENTMACHINE %s
TEXTATTACHMENT %s BINARYATTACHMENT %s' \
            % (emailTo, STAFUtil.wrapData(emailSubject), STAFUtil.wrapData
(emailMessage), \
               STAFUtil.wrapData(emailAttachmentMachine), STAFUtil.wrapData
(emailTextAttachment),
               STAFUtil.wrapData(emailBinaryAttachment))
        </request>
      </stafcmd>

      <message log="1">'Email RC=%s, Result=%s' % (RC,
STAFResult)</message>

    </sequence>

  </function>

</stax>

Thanks,
David
                                                                       
 David Bender          11501 Burnet Rd.   Phone (T/L): 1-512-286-5315  
 STAF/STAX Development Bldg. 903-5B002    (363-5315)                   
                       Austin, TX         ITN: 23635315                
 IBM Software Group,   78758-3400         Email: bda...@us.ibm.com     
 WPLC                                                                  
                                                                       






Inactive hide details for Cindy Zhu ---03/11/2011 02:35:27 PM---Hi, Can you
show me how to attach files to an email and send thCindy Zhu ---03/11/2011
02:35:27 PM---Hi, Can you show me how to attach files to an email and send
the email from a STAX job?


                                                                       
                                                                       
 From:          Cindy Zhu <c...@fekete.com>                            
                                                                       
                                                                       
 To:            "staf-users@lists.sourceforge.net"                     
                <staf-users@lists.sourceforge.net>                     
                                                                       
                                                                       
 Date:          03/11/2011 02:35 PM                                    
                                                                       
                                                                       
 Subject:       [staf-users] Attachment                                
                                                                       






Hi,

Can you show me how to attach files to an email and send the email from a
STAX job?

Thanks,

Cindy
------------------------------------------------------------------------------

Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

<<inline: 28960572.gif>>

<<inline: 28623302.gif>>

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to