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 » RESOLVED: Sending email as HTML with IA07

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 RESOLVED: Sending email as HTML with IA07 « View previous topic :: View next topic » 
Author Message
jrjoe
PostPosted: Mon Nov 27, 2006 1:31 pm    Post subject: RESOLVED: Sending email as HTML with IA07 Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

I have been working with the IA07 plug-in and I have been having problems sending html documents in the body of a email.

I am using WMB ver 6 and the flow is:

MQInput --> Sendmail --> MQOutput

I am putting a sample xml message on the input queue and it is delivered but it doesn't show up as a html document when I open the email. I am using Lotus Notes for my email client.

Any help on the correct way to build a XML email file with html tags in the body would be greatly appreciated.

Thanks in advance.


Last edited by jrjoe on Thu Dec 14, 2006 12:34 pm; edited 2 times in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Nov 27, 2006 3:53 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I'd say your ESQL is wrong.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jrjoe
PostPosted: Tue Nov 28, 2006 6:22 am    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

I do have a compute node before the sendmail plugin but for now I am just passing the XML message that is put on the queue to the send mail without changing anything in the compute node. Is there something I need to do with ESQL to change the message before sending it to the mail plug-in?
If anyone has a simple example that would be greatly appreciated.

Thanks
Joe
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 28, 2006 6:35 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Then I'd say the XML is wrong.

But these are just guesses, becuase you haven't provided any specific information.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jrjoe
PostPosted: Tue Nov 28, 2006 6:48 am    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

The following is the XML message that I am putting to the queue.
I use a valid email address in the from and to fields but put mymail@xxx.com for this example.


<Message>
<From>mymail@xxx.com</From>
<To>mymail@xxx.com</To>
<Subject>An e-mail test for Plug-in</Subject>
<Body>
<![CDATA[<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css"></head><BODY>
Dear Cardmember,<br><br>Due to a temporary system problem, your Payment Received Alert sent on February 12th contained the incorrect payment amount. view your recent payments and account activity online,<br>Again, we apologize for this inconvenience.
<br><br>For a list of phone numbers, please click <a href=http://www.google.com>here</a><br><br><b>Privacy Statement</b>
</BODY></html>]]>
</Body>
</Message>


Thanks
Joe
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 28, 2006 7:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So you're not setting the MIME headers to indicate that the content type of the data is text/html.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jrjoe
PostPosted: Tue Nov 28, 2006 7:21 am    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

I am setting the content in the html document to text/html.
Where or how do I set the MIME headers? Is this something that I need to do using ESQL or can I set the MIME headers in the XML document?

Thanks in advance
Joe
Back to top
View user's profile Send private message
vk
PostPosted: Tue Nov 28, 2006 10:09 am    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

You dont need to set the message body as CDataSection of element Body. This is required only when sending email attachments.

Try sending the message body directly in the element Body.

Regards,
VK.
Back to top
View user's profile Send private message
jrjoe
PostPosted: Tue Nov 28, 2006 10:35 am    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

If I don't use the CData then the HTML tags will look like XML tags right?

I have the MQInputNode "Message Domain = XML"

The following is the ESQL from the Compute Node:

CREATE COMPUTE MODULE emailPlugin_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
-- Set OutputRoot."BLOB"."BLOB" = BITSTREAM(InputBody);
RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER;
DECLARE J INTEGER;
SET I = 1;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
Back to top
View user's profile Send private message
jrjoe
PostPosted: Tue Nov 28, 2006 1:12 pm    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

I am adding the output from the trace nodes and the body tag going into the mailplugin looks correct.

Any ideas on what I am missing here?

EmailIn.txt - This is the trace after the MQInput node

Message passed through with the following fields:
Msg is: (
(0x01000000):Properties = (
(0x03000000):MessageSet = ''
(0x03000000):MessageType = ''
(0x03000000):MessageFormat = ''
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 819
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2006-11-28 20:55:59.640'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'POC.EMAIL.IN'
(0x03000000):Transactional = FALSE
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 819
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120495558585844303120202020454518ae20179202'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'IUXXXD01 '
(0x03000000):UserIdentifier = 'mqm '
(0x03000000):AccountingToken = X'0000000000000000000000000000000000000000000000000000000000000000'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 28
(0x03000000):PutApplName = 'MQSeries Client for Java '
(0x03000000):PutDate = DATE '2006-11-28'
(0x03000000):PutTime = GMTTIME '20:55:59.640'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000010):XML = (
(0x01000000):Message = (
(0x01000000):From = (
(0x02000000): = 'Myemail@.xxx.com'
)
(0x02000000): = '
'
(0x01000000):To = (
(0x02000000): = 'Myemail@.xxx.com'
)
(0x02000000): = '
'
(0x01000000):Subject = (
(0x02000000): = 'An e-mail last test for Plug-in'
)
(0x02000000): = '
'
(0x01000000):Body = (
(0x02000000): = '
'
(0x02000001): = '<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css"></head><BODY>Dear Cardmember,<br><br>Due to a temporary system problem, your Payment Received Alert sent on February 12th contained the incorrect payment amount. view your recent payments and account activity online,<br>Again, we apologize for this inconvenience.<br><br>For a list of phone numbers, please click <a href=http://www.google.com>here</a><br><br><b>Privacy Statement</b>For details on our e-mail practices.</BODY></html>'
(0x02000000): = '
'
)
(0x02000000): = '
'
)
(0x06000002): = '





'
)
)
Time is: 20:55


Next is the trace after the Compute node going into the sendmail plugin:

Message passed through with the following fields:
Msg is: (
(0x01000000):Message = (
(0x01000000):From = (
(0x02000000): = 'Myemail@.xxx.com'
)
(0x02000000): = '
'
(0x01000000):To = (
(0x02000000): = 'Myemail@.xxx.com'
)
(0x02000000): = '
'
(0x01000000):Subject = (
(0x02000000): = 'An e-mail last test for Plug-in'
)
(0x02000000): = '
'
(0x01000000):Body = (
(0x02000000): = '
'
(0x02000001): = '<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css"></head><BODY>Dear Cardmember,<br><br>Due to a temporary system problem, your Payment Received Alert sent on February 12th contained the incorrect payment amount. view your recent payments and account activity online,<br>Again, we apologize for this inconvenience.<br><br>For a list of phone numbers, please click <a href=http://www.google.com>here</a><br><br><b>Privacy Statement</b>For details on our e-mail practices.</BODY></html>'
(0x02000000): = '
'
)
(0x02000000): = '
'
)
(0x06000002): = '




Last is the trace after the sendmail plugin gooing to the MQOut Node:

Message passed through with the following fields:
Msg is: (
(0x01000000):Properties = (
(0x03000000):MessageSet = ''
(0x03000000):MessageType = ''
(0x03000000):MessageFormat = ''
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 819
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2006-11-28 20:55:59.640'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'POC.EMAIL.IN'
(0x03000000):Transactional = FALSE
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 819
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120495558585844303120202020454518ae20179202'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'IUXXXD01 '
(0x03000000):UserIdentifier = 'mqm '
(0x03000000):AccountingToken = X'0000000000000000000000000000000000000000000000000000000000000000'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 28
(0x03000000):PutApplName = 'MQSeries Client for Java '
(0x03000000):PutDate = DATE '2006-11-28'
(0x03000000):PutTime = GMTTIME '20:55:59.640'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000010):XML = (
(0x01000000):Message = (
(0x01000000):From = (
(0x02000000): = 'Myemail@.xxx.com'
)
(0x02000000): = '
'
(0x01000000):To = (
(0x02000000): = 'Myemail@.xxx.com'
)
(0x02000000): = '
'
(0x01000000):Subject = (
(0x02000000): = 'An e-mail last test for Plug-in'
)
(0x02000000): = '
'
(0x01000000):Body = (
(0x02000000): = '
'
(0x02000001): = '<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css"></head><BODY>Dear Cardmember,<br><br>Due to a temporary system problem, your Payment Received Alert sent on February 12th contained the incorrect payment amount. view your recent payments and account activity online,<br>Again, we apologize for this inconvenience.<br><br>For a list of phone numbers, please click <a href=http://www.google.com>here</a><br><br><b>Privacy Statement</b>For details on our e-mail practices.</BODY></html>'
(0x02000000): = '
'
)
(0x02000000): = '
'
)
(0x06000002): = '
Back to top
View user's profile Send private message
EddieA
PostPosted: Tue Nov 28, 2006 2:14 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

The one thing you haven't told us, is what do you get at the e-mail client.

Have you tried sending it to a non-Lotus client.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
jrjoe
PostPosted: Tue Nov 28, 2006 3:44 pm    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

Sorry about that,

When I open the mail it shows as only text:

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css"></head><BODY>Dear Cardmember,<br><br>Due to a temporary system problem, your Payment Received Alert sent on February 12th contained the incorrect payment amount. view your recent payments and account activity online,<br>Again, we apologize for this inconvenience.<br><br>For a list of phone numbers, please click <a href=http://www.google.com>here</a><br><br><b>Privacy Statement</b>For details on our e-mail practices.</BODY></html>


I have not sent it to a non-Lotus client since I don't have one available in this enviorment. It is a test area only.
I have been able to send html emails to the production Lotus notes from a hotmail account.

Thanks
Joe
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Nov 29, 2006 9:49 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
I am setting the content in the html document to text/html.


Isn't that like locking the keys inside the safe. You're saying that it's HTML, but inside the HTML.

jefflowrey wrote:
So you're not setting the MIME headers to indicate that the content type of the data is text/html.


Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
jrjoe
PostPosted: Wed Nov 29, 2006 10:28 am    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

jefflowrey wrote:
Quote:
So you're not setting the MIME headers to indicate that the content type of the data is text/html.


I guess my question is how and/or where do I set the MIME headers?
I don't see anything in the documentation for the IA07 saying where this should be set.
Can someone please let me know how or where this should be done?

Thanks in advance
Joe
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Nov 29, 2006 10:29 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The documentation includes examples of setting the ContentType of 7-bit text areas.

If you are trying to pass Unicode HTML, then you need, unfortunately, to base64 encode it as SMTP does not, as far as I know, support Unicode or anything other than 7bit text.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » RESOLVED: Sending email as HTML with IA07
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.