Author |
Message
|
WMB_User |
Posted: Mon Nov 24, 2008 8:06 am Post subject: EmailOutput Attachment |
|
|
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:
|
|
Back to top |
|
 |
ggriffith |
Posted: Mon Nov 24, 2008 8:31 am Post subject: |
|
|
 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 |
|
 |
WMB_User |
Posted: Mon Nov 24, 2008 8:58 am Post subject: EmailOutput Attachment |
|
|
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 |
|
 |
ggriffith |
Posted: Mon Nov 24, 2008 9:10 am Post subject: |
|
|
 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 |
|
 |
WMB_User |
Posted: Mon Nov 24, 2008 9:52 am Post subject: EmailOutput Attachment |
|
|
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 |
|
 |
ggriffith |
Posted: Tue Nov 25, 2008 2:20 am Post subject: |
|
|
 Acolyte
Joined: 17 Oct 2007 Posts: 67
|
After both. Just put
CALL CopyMessageHeaders();
before the code I've just given you. |
|
Back to top |
|
 |
Glass |
Posted: Mon Feb 09, 2009 11:58 am Post subject: |
|
|
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 |
|
 |
smdavies99 |
Posted: Mon Feb 09, 2009 12:29 pm Post subject: |
|
|
 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 |
|
 |
Glass |
Posted: Mon Feb 09, 2009 12:42 pm Post subject: |
|
|
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 |
|
 |
smdavies99 |
Posted: Mon Feb 09, 2009 1:05 pm Post subject: |
|
|
 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 |
|
 |
ggriffith |
Posted: Tue Feb 10, 2009 2:08 am Post subject: |
|
|
 Acolyte
Joined: 17 Oct 2007 Posts: 67
|
have you remembered to reset to Blob before you get to the compute node |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Feb 10, 2009 3:18 am Post subject: |
|
|
 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 |
|
 |
Glass |
Posted: Tue Feb 10, 2009 8:21 am Post subject: |
|
|
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 |
|
 |
|