ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » EmailOutput Attachment

Post new topic  Reply to topic
 EmailOutput Attachment « View previous topic :: View next topic » 
Author Message
WMB_User
PostPosted: Mon Nov 24, 2008 8:06 am    Post subject: EmailOutput Attachment Reply with quote

Apprentice

Joined: 17 Nov 2008
Posts: 31

Can't seem to get the Attachment feature of the EmailOutputnode to work properly. As documented, I serialized the incoming request:
Code:
DECLARE inCCSID    INT  InputRoot.Properties.CodedCharSetId;                     
DECLARE inEncoding INT  InputRoot.Properties.Encoding;                       
DECLARE inBitStream BLOB ASBITSTREAM(InputRoot.XMLNSC, inEncoding, inCCSID);
CREATE LASTCHILD OF OutputLocalEnvironment DOMAIN('BLOB') parse(inBitStream);   

The properties tab of the EmailOutput node are:
Code:
Content: $LocalEnvironment/
Content Type: text/plain
Content Encoding: 7-bit
Multipart Content Type: mixed

However, the email attachment when received has the following 18 bytes of content:
Code:
$LocalEnvironment/
Back to top
View user's profile Send private message
ggriffith
PostPosted: Mon Nov 24, 2008 8:31 am    Post subject: Reply with quote

Acolyte

Joined: 17 Oct 2007
Posts: 67

Before you build the message insert a ResetContentDescriptor node to convert to BLOB domain then when you build the the mail message include

OutputLocalEnvironment.Destination.Email.Attachment.Content = InputRoot.BLOB.BLOB;
OutputLocalEnvironment.Destination.Email.Attachment.ContentName = 'whateveryouwant.txt';
Back to top
View user's profile Send private message
WMB_User
PostPosted: Mon Nov 24, 2008 8:58 am    Post subject: EmailOutput Attachment Reply with quote

Apprentice

Joined: 17 Nov 2008
Posts: 31

I admit I'm still a bit confused.

Where am I setting......
Code:
OutputLocalEnvironment.Destination.Email.Attachment.Content = InputRoot.BLOB.BLOB;
OutputLocalEnvironment.Destination.Email.Attachment.ContentName = 'whateveryouwant.txt';

........in a Compute node? What Attachement precise values do I set on the properties of the EmailOutput node.
Back to top
View user's profile Send private message
ggriffith
PostPosted: Mon Nov 24, 2008 9:10 am    Post subject: Reply with quote

Acolyte

Joined: 17 Oct 2007
Posts: 67

Yes in a compute node. The only property you need to set on the EmailOutput node is the server and port, providing you're setting the basics as below

SET OutputRoot.EmailOutputHeader.To = 'fred@help.com';
SET OutputRoot.EmailOutputHeader.From = 'joe@here.com;
SET OutputRoot.EmailOutputHeader.Subject = 'Just to get you started';
SET OutputRoot.XMLNS.EMail.Body.Line1 = 'An email + attachement';
SET OutputLocalEnvironment.Destination.Email.Attachment.Content = InputRoot.BLOB.BLOB;
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentName = 'whateveryoulike.txt';
Back to top
View user's profile Send private message
WMB_User
PostPosted: Mon Nov 24, 2008 9:52 am    Post subject: EmailOutput Attachment Reply with quote

Apprentice

Joined: 17 Nov 2008
Posts: 31

Does the EmailOutputHeader have a specific location in the Message tree (after MQMD or Properties) ?
Back to top
View user's profile Send private message
ggriffith
PostPosted: Tue Nov 25, 2008 2:20 am    Post subject: Reply with quote

Acolyte

Joined: 17 Oct 2007
Posts: 67

After both. Just put

CALL CopyMessageHeaders();

before the code I've just given you.
Back to top
View user's profile Send private message
Glass
PostPosted: Mon Feb 09, 2009 11:58 am    Post subject: Reply with quote

Acolyte

Joined: 02 Mar 2006
Posts: 56

Sorry to open up an old thread but has anybody got this working?

I cannot get an attachment going on the email. I am not using the property node of the EmailOutput node but coding it in the compute node prior to the EmailOutput node. The subject/to/from/content of the email works fine but not the attachment.

Thanks!
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Feb 09, 2009 12:29 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

I have used this succesfully to add a .zip attachment to an email

I used the Sample provided with V6.1 where if you read the notes carefully, you can include an attachment.
Add some TRace nodes after the various nodes and look at the folders and see how it structures them to get the attachment sent.
Then replicate this in your flow.
That is how I did it. I'm sure you can to...
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Glass
PostPosted: Mon Feb 09, 2009 12:42 pm    Post subject: Reply with quote

Acolyte

Joined: 02 Mar 2006
Posts: 56

I have looked at that but I am not using any JavaCompute or HTTPInput. I am using basic MQInput and ESQL compute. Here is what I have:

Code:

SET OutputRoot.EmailOutputHeader.Subject = 'test subject';
SET OutputRoot.EmailOutputHeader.From = 'abc@company.com';
SET OutputRoot.EmailOutputHeader.To = 'xyz@company.com';
SET OutputRoot.XMLNSC.Email.BR[1]    = 'email body text';
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentType = 'text/plain';
SET OutputLocalEnvironment.Destination.Email.Attachment.Content = InputRoot.BLOB.BLOB;
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentName = 'myEmailAttachment.txt';
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Feb 09, 2009 1:05 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Yes, the sample uses a JCN. That is why I suggested adding trace nodes and looking at the various folders in the Root & LocalEnvironment.
Then you can duplicate that in the sample using a conventional Compute Node.
That is how I did my development.
Remember, Trace nodes are your friend
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
ggriffith
PostPosted: Tue Feb 10, 2009 2:08 am    Post subject: Reply with quote

Acolyte

Joined: 17 Oct 2007
Posts: 67

have you remembered to reset to Blob before you get to the compute node
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Feb 10, 2009 3:18 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Glass wrote:
I have looked at that but I am not using any JavaCompute or HTTPInput. I am using basic MQInput and ESQL compute. Here is what I have:

Code:

SET OutputRoot.EmailOutputHeader.Subject = 'test subject';
SET OutputRoot.EmailOutputHeader.From = 'abc@company.com';
SET OutputRoot.EmailOutputHeader.To = 'xyz@company.com';
SET OutputRoot.XMLNSC.Email.BR[1]    = 'email body text';
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentType = 'text/plain';
SET OutputLocalEnvironment.Destination.Email.Attachment.Content = InputRoot.BLOB.BLOB;
SET OutputLocalEnvironment.Destination.Email.Attachment.ContentName = 'myEmailAttachment.txt';


As you are using a BLOB as the attachment ( = InputRoot.BLOB.BLOB) then the properties for the attachment are wrong.
ContentType should be 'application/octect-stream',
And you should also set the .ContentEncoding to 'Base64'

I have also found that it works when
1) I set values for ALL the fields in the Email Header
2) And they are set in the correct order
To, From,CC,Bcc, Reply, Subject

Then the Attachment has the values set in order
Content,ContentType,ContentName,ContentEncoding
and finally to set the MultiContentType = ''


As I have said before, please use trace nodes and then you can show us exactly what you are sending to the EmailOutput node.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Glass
PostPosted: Tue Feb 10, 2009 8:21 am    Post subject: Reply with quote

Acolyte

Joined: 02 Mar 2006
Posts: 56

Stupid mistake like someone mentioned in another thread.

Set the compute node's "Compute mode" to "LocalEnvironment and Message" in the Basic tab. That worked.

Thanks for all help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » EmailOutput Attachment
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.