• Share
  • ?
  • Profiles ▼
  • Communities ▼
  • Apps ▼

Blogs

  • My Blogs
  • Public Blogs
  • My Updates

This community can have members from outside your organization. HermannSW

  • Log in to participate

▼ Tags

▼ Similar Entries

Howto: easy callout ...

Blog: HermannSW
HermannSW 2700006U54
Updated
0 people like thisLikes 0
No CommentsComments 0

DataPower as a REST ...

Blog: Me, myself an...
Offline 0600018ME9
Updated
1 people likes thisLikes 1
No CommentsComments 0

BiLog: Immediate an...

Blog: Asset Managem...
PamDenny 270000BXV7
Updated
0 people like thisLikes 0
No CommentsComments 0

How to configure Fil...

Blog: IBM FileNet
Juan.Hasang 270003YRJ3
Updated
0 people like thisLikes 0
No CommentsComments 0

Fix: Attachments Unk...

Blog: Asset Managem...
Yalcin Kumbasar 270006B8DE
Updated
0 people like thisLikes 0
No CommentsComments 0

▼ Similar Ideas

Attachemt included i...

Ideation Blog: IBM Forms Exp...
Jeppe 270002FSNM
Updated
Votes 4 No CommentsComments 0

▼ Archive

  • March 2018
  • November 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • October 2016
  • May 2016
  • April 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011

▼ Blog Authors

HermannSW

View All Entries
Clicking the button causes a full page refresh. The user could go to the "Entry list" region to view the new content.) Entry list

smtp

HermannSW 2700006U54 | | Tags:  binary datapower dp:url-open with email smtp send attachment xslt ‎ | 5 Comments ‎ | 16,891 Views

 

In this developerWorks DataPower forum posting the question was raised how to make DataPower send emails with (binary) attachments.
 
Technote "Sending HTML data using IBM WebSphere DataPower SOA Appliance SMTP url-open extension function" from June this year
http://www-01.ibm.com/support/docview.wss?uid=swg21291029
 
is a first step. There we can learn that MIME="true" is necessary to do anything more than sending just a normal text email.
 
 
Next looking up InfoCenter for url-open (SMTP URLs)  tells us that we have to create the raw MIME message ourselves (as in the technote above).
 
MIME=true | false
Indicates whether the message body is already in the Multipurpose Internet Mail Extensions (MIME) format. The
message is in MIME format when the message body starts with headers. In this case, set to true. The default is
false. When set to true, the entire header segment, which is all of the headers of the e-mail message, is limited to 1 KB.
 
 

Stylesheet smtp.xsl (5.1 KB)  just demonstrates how to do that.

Even more, it provides function mime:sendBodyWithAttachment() for easily sending an email with attachment.
This function makes use of  function mime:split64() for ensuring that the base64 encoded (binary) attachment data has at most 76 characters per line (MIME spec requirement).
 
The attachment sent with the email is retrieved from my private website via another dp:url-open() GET request, see this slide on getgif.xsl:
http://www-01.ibm.com/support/docview.wss?uid=swg27022979&aid=3#page=18
 
Please see these two Webcasts on "Non-XML Data Processing in WebSphere DataPower SOA Appliances Stylesheets" for details on binary data processing:
http://www-01.ibm.com/support/docview.wss?uid=swg27022977
http://www-01.ibm.com/support/docview.wss?uid=swg27022979
 
 
Using coproc2 to execute smtp.xsl returns "sent".
image
 
 
The email got sent to my private email address.
This screenshot of my webmail client proves that sending the email with attachment really worked:
image
 
 
Last, but not least, I want to use this posting for a graphical experiment.
 
Since the code listings available in this blog are not as "nice" as those in developerWorks forum I took a screenshot of the
terminal with syntax highlighted listing of smtp.xsl. Since best display in this blog is for pictures of width exactly 400 pixels
I had to zoom out a little ... the resulting screenshot is a 400x1770 pixel(!) .gif image.
Good that I have a 24'' monitor in my office and a 1920x1200 graphic card for working in "Left" instead of "Normal" view ... :-)
OK, here we go:
image

 
 
Happy emailing with DataPower,
 
Hermann.
 
Modified on by HermannSW 2700006U54
  • Add a Comment Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry
Notify Other People
notification

Send Email Notification

+

Quarantine this entry

deleteEntry
duplicateEntry

Mark as Duplicate

  • Previous Entry
  • Main
  • Next Entry
Feed for Blog Entries | Feed for Blog Comments | Feed for Comments for this Entry