|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to send a HTML e-mail using Message Broker. |
« View previous topic :: View next topic » |
Author |
Message
|
SHill3 |
Posted: Fri Mar 07, 2008 9:20 am Post subject: How to send a HTML e-mail using Message Broker. |
|
|
Newbie
Joined: 07 Mar 2008 Posts: 3
|
Hi everybody!!, I'm very confused, I'm trying to send an email in HTML format using Websphere Message Broker, My source file is an ASCII file, it contains information from 3 different clients, I have to split the information and send the corresponding records via email to each client, I've already splited the information with no problems, but when I send it, the email is not correctly formatted.
Somebody can help me?, please give me a hint or a clue.
Thanks for advance.  |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 07, 2008 9:46 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What does it mean "not correctly formatted"?
What version of Broker? What means of sending email?
What is your code written? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
SHill3 |
Posted: Fri Mar 07, 2008 11:19 am Post subject: |
|
|
Newbie
Joined: 07 Mar 2008 Posts: 3
|
Hi Jefflowrey, Let's see.
I'm using Websphere Message Broker 6.1, My message flow is quite simple: it has a MQInput node, a compute node and an EmailOutput node.
First, the MQInput node recives an ASCII file (CSV) and send the message to the compute node.
Next the compute node recives the message to procees it (currently the message contains records from 3 different clients, so it has to split the information because I have to send via email all the corresponding records to each client).
Then using all the related records from one especific client, I have to put them together inside a message and propagate it to the emailoutput node in order to send them via emial.
I repeat these procedure for each different client using a "While .... do".
At these time, I can read the ASCII file, I can split all the correspondig records from each client, put them together into a message and propagate it to the EmailOutput node, when I open the email I see all the corespondig records (everything seems to be fine...) but I can see the HTML tags mixed with the information, something like this:
Code: |
<table>
<td><tr>Date</tr><tr>03-07-2008</tr>
<td><tr>Client</tr><tr>ABC Inc.</tr>
</table> |
I don´t want to see that tags as part of the text, I want to see the information as a HTML table.
I've already tried this:
SET OutputLocalEnvironment.Destination.ContentType = 'text/html' ;
SET OutputRoot.Properties.ContentType = 'text/html' ;
but nothing happens.
The ASCII file (CSV) looks like this:
Code: |
ABC Inc,03-07-2008,Buy,20,Pencil
ABC Inc,03-07-2008,Pay,10.00
DEF Cia,03-07-2008,Buy,15,Notebook
DEF Cia,03-07-2008,Pay,13.50 |
following that example I want to divide the information in 2 different emails and format them into an HTML table:
Code: |
Client: ABC Inc.
DATE Operation Detail
03-07-2008 Buy 20 Pencils
03-07-2008 Pay 10.00 |
And so on....
I hope this information will be useful for you, I hope you can help me!! |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 07, 2008 11:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What is the content type of the email message you are sending?
What other email headers are you setting?
How is your email client configured to display HTML data? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
SHill3 |
Posted: Fri Mar 07, 2008 1:50 pm Post subject: |
|
|
Newbie
Joined: 07 Mar 2008 Posts: 3
|
about the conten type of the email message, I set this property just using the next code....,
Code: |
SET OutputLocalEnvironment.Destination.ContentType = 'text/html' ;
SET OutputRoot.Properties.ContentType = 'text/html' ; |
I read the EmailOutput node help and I found that, so that's why I'm using those properties.
About other email headers, I'm setting the next ones.
Code: |
SET OutputRoot.EmailOutputHeader.To = 'an email account' ;
SET OutputRoot.EmailOutputHeader.From = 'the sender account' ;
SET OutputRoot.EmailOutputHeader.Subject = 'the main topic' ; |
And finally, the destinations are Hotmail, yahoo and Gmail accounts, I think it is no necesary to configure them, isn't it?
Thanks!!  |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Mar 07, 2008 1:57 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Sorry, I didn't see the content type in your first message.
Yes, one would hope that an HTML based email client would display HTML email as HTML by default.
Is the entirety of your email body an HTML document? Or do you just have some HTML markup inside an otherwise text document?
Does the received email show up as text/html? Or something else? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
gregop |
Posted: Sat Mar 08, 2008 7:53 am Post subject: |
|
|
Voyager
Joined: 24 Nov 2006 Posts: 81
|
Quote: |
SET OutputLocalEnvironment.Destination.ContentType = 'text/html' ; |
If using local environment for Content type you should be setting it like this:
OutputLocalEnvironment.Destination.Email.BodyContentType = 'text/html'
You could just set it on the EMail node. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|