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 Previous  1, 2, 3  Next
 RESOLVED: Sending email as HTML with IA07 « View previous topic :: View next topic » 
Author Message
jrjoe
PostPosted: Wed Nov 29, 2006 10:34 am    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

In the examples it only showed the ContentType of 7-bit text areas for doing attachmates. I didn't see anything for HTML

Does anyone have a simple HTML sample I could revview?

Thanks
Joe
Back to top
View user's profile Send private message
jrjoe
PostPosted: Wed Nov 29, 2006 1:31 pm    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

I was able to from command line on a UNIX server send an HTML email to the Notes server using SMTP commands:

telnet SERVERNAME.DOMAIN.com 25
Trying...
Connected to SERVERNAME.DOMAIN.com.
Escape character is '^]'.
220 ***********************
helo ClientName.DOMAIN.com
250 +OK SMTP server Ready
mail from: myemail@xxx.com
250 +OK Sender OK
rcpt To: myemail@xxx.com
250 +OK Recipient OK
DATA
354 Start mail input, end with "<CR><LF>.<CR><LF>"
From: myemail@xxx.com
To: myemail@xxx.com
Subject: Html Test Message
Mime-Version:1.0;
Content-Type: text/html; charset="ISO-8859-1";
Content-Transfer-Encoding: 7bit;

<html>
<body>
<H2>this is a sample link to look at</h2>
Here it is <a href="http://www.google.com"> Click</a>
</body>
</html>
.
250 +OK message queued for delivery.
quit
221 Service closing transmission channel closing connection
Connection closed.


I see that I need the MIME setting but not sure on to set it with the Plug-in or where in the XML message to put this infomation.

Any ideas on this?

Thanks
Joe
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Nov 29, 2006 2:00 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You could always send an email to the author of the Support Pack.

Or you could continue to wait around until someone else feels like solving your problem for you.

Or you could start trying things, and examining the results.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jrjoe
PostPosted: Wed Nov 29, 2006 8:20 pm    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

I have sent an email to the Support Pac author and hoping to here back.
Once I do I will post the results here for others to benefit from.


jefflowrey wrote:
Quote:
Or you could continue to wait around until someone else feels like solving your problem for you.

Or you could start trying things, and examining the results.


I am not waiting for someone to solve this I have just ask for help with this. I am and will continue to try things and look at the results. As well as read up on it.

If you don't have any answers for my question that is fine just say so.

Thanks
Joe
Back to top
View user's profile Send private message
prasadpav
PostPosted: Thu Nov 30, 2006 9:54 am    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

Hi,
Perhaps this might help. (Mostly taken from the support pack PDF):

1) Set your SendMail parameters as follows:

Under MIME heading,
Quote:

ContentTypeEncoding -> Base64
MIME -> select this checkbox


2) Within your ESQL, do the following

Quote:


CREATE LASTCHILD OF OutputRoot.XML.Message NAME 'EncodingBase64';

SET OutputRoot.BLOB.BLOB = CAST(InputRoot.XML.Message.Body AS BLOB ccsid 1208); -- NOTE: InputRoot.XML.Message.Body points to your HTML data. Change this accordingly.

SET OutputRoot.XML.Message.Body = 'This is the body of the email';
SET OutputRoot.XML.Message.EncodingBase64.(XMLAttribute)ContentType = 'text/html';
SET OutputRoot.XML.Message.EncodingBase64.(XMLAttribute)Name = 'Sample.html';



See if it works....in your email you should be able to see an HTML attachment with name 'sample.html';

Regards,
Prasad
Back to top
View user's profile Send private message
prasadpav
PostPosted: Thu Nov 30, 2006 10:01 am    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

Sorry, my bad, did not realised that you want to see HTML document within the mail itself and not as an attachment. Please ignore my previous post.

Prasad
Back to top
View user's profile Send private message
EddieA
PostPosted: Fri Dec 01, 2006 11:24 am    Post subject: Reply with quote

Jedi

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

The SupportPac comes with source code. Perhaps you can modify it to include the additional headers required.

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: Fri Dec 01, 2006 1:11 pm    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

Thanks for the post Prasad.

Eddie, so the Plug-in as is will not handle the headers for html:

Mime-Version: 1.0
Content-Type: text/html;charset=ISO-8859-1


I will look at the source. I was hoping to be able to use it as is.
Thanks for the info.
Back to top
View user's profile Send private message
EddieA
PostPosted: Fri Dec 01, 2006 5:19 pm    Post subject: Reply with quote

Jedi

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

I don't know, I haven't tried.

Look at the supplied samples, and try changing a few things.

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
whocares61
PostPosted: Wed Dec 06, 2006 6:26 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2006
Posts: 7
Location: New Zealand

Hi jrjoe,

Wonder how is it going with your problem?

I bumped into the same issue when using out-of-the-box EMail Connector. Any HTML code passed as a message body is ignored, unless you hardcode your text as a string. Otherwise connector seems to be trying to parse HTML as XML...

I gave it a shot and tried to use SendMailPlugin instead, and have got the same result as you. So, obviously this plugin is not a workaround I'm looking for. Unless you have good news

Cheerio
Back to top
View user's profile Send private message Visit poster's website
jrjoe
PostPosted: Wed Dec 06, 2006 7:37 pm    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

Have you tried using CDATA with your html?

<![CDATA[<html><body>
html tags \
</body></html>]]>

This may help you with the Email Connector issue, I am not to familiar with it.
As far as my issue may be getting close. I have been reading the RFC822 paper regarding the email headers.

I will post my results once I am done.

Good luck
Back to top
View user's profile Send private message
whocares61
PostPosted: Thu Dec 07, 2006 2:38 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2006
Posts: 7
Location: New Zealand

Tried this as well -- getting blank message, although empty tag <![CDATA[]]> does exist in the body when the source of the message is viewed.

I probably should try to transform HTML to String explicitly before constructing the message, but how, I'm not sure...

Good luck to you too.
Back to top
View user's profile Send private message Visit poster's website
whocares61
PostPosted: Wed Dec 13, 2006 2:26 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2006
Posts: 7
Location: New Zealand

Hi jrjoe,

Looks like I resolved my problem with EMail Connector, and this might work for SendMailPlugin as well.

In my case the trick is in XSLTransform node, which I use before sending HTML body content to the EMail Connector. XSLT node uses specially crafted stylesheet which looks like:

Code:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
   xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes">
   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
      
   <xsl:template match="/">
       <html>
         <body>
            <xsl:apply-templates select="." mode="html"/>               </body>
      </html>      
   </xsl:template>
   <xsl:template match="text()" mode="htmlvalue">
      <xsl:value-of select="."/>
      <xsl:text>&lt;BR&gt;</xsl:text>         
   </xsl:template>

</xsl:stylesheet>


MOST important here is this line:
Code:

         <xsl:text>&lt;BR&gt;</xsl:text>

because it shows how HTML tags must be injected inside the message body.

In my case it was proven to be the only way to trick EMail Connector to pass HTML code in the body successfully.



HTH

Cheers
Back to top
View user's profile Send private message Visit poster's website
jrjoe
PostPosted: Thu Dec 14, 2006 6:20 am    Post subject: Reply with quote

Acolyte

Joined: 20 Jan 2003
Posts: 60

Thanks for the update on that. I am able to successful send the HTML text in the body of the message but the "Content-Type" is always set to "text/plain" not "text/html" I have tried several ways to get this chance but it looks like the Plug-in it self doesn't allow the Content-Type to be changed, at least not where I can see. I am trying to contact the author one last time and last resource I may need to change the source to include the text/html.

On the Email Connector is there a way to change the Content-Type?

Thanks
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Dec 14, 2006 11:30 am    Post subject: Reply with quote

Jedi

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

The mail7bit example has the following embedded in the XML: ContentType="text/plain"

Have you tried setting ContentType="text/html" to see if that works.

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
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next Page 2 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.