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 » Problem in Send Mail Plugin

Post new topic  Reply to topic
 Problem in Send Mail Plugin « View previous topic :: View next topic » 
Author Message
abhishekpreddy
PostPosted: Wed Aug 29, 2007 3:30 am    Post subject: Problem in Send Mail Plugin Reply with quote

Apprentice

Joined: 02 May 2007
Posts: 49

Hi ,

I am using the Send Mail Plugin to send out emails from the MB , i am using MBV6 , I get a problem when i send out XML as the content of my email , the XML just gets formatted in an un even manner and is totally distorted in the mail body.

Should this be a problem in the Send Mail Plugin or a problem with the SMTP server in the way it interprets the XML message.

Thanks in advance.

regards,
Abhishek
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 29, 2007 3:56 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Most SMTP servers should not interpret the message data.

Can you describe how you are putting the XML into the message, and how it is getting formatted in an uneven manner?

You do know that XML is defined to explicitly ignore whitespace outside of element content, right? So that the XML
<root><element>abc</element></root>

is supposed to be treated the same as
<root>
<element>abc</element>
</root>
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
abhishekpreddy
PostPosted: Wed Aug 29, 2007 4:03 am    Post subject: Reply with quote

Apprentice

Joined: 02 May 2007
Posts: 49

Hi jeff ,

Thanks for the reply , I am wrapping the XML in CDATA section and then passing it over to the Send Mail plugin , so the message format should be something like this
<Message>
<Body>
CDATA[My XML]
</Body>
</Message>

My doubt is the same if SMTP is not meddleing with the data , then why does my XML apper in the email body something like this

<XML>
<Shi
pment> This is a
sample Order </Shipment>
</xml>
something like this.

thanks in advance.

regards,
Abhishek
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 29, 2007 4:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The XML message that you supply to the Sendmail node is used to instruct the sendmail node how to build the email.

So the Sendmail node is going to take the contents of the <Body> tag, and attach that as the Body of the email.

Likewise it's going to take the contents of the <To> tag, and put that into the To field on the email.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
vk
PostPosted: Wed Aug 29, 2007 10:56 am    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

Hi Abhishek,

Per the documentation for SendMailPlugIn node, only email attachment data should be set in CDataSection of the input XML. Data which you want to come in the email body can be directly assigned to Message\Body of the XML input to the SendMailPlugIn node.

Since it is an XML within an XML, make sure that you use the XML.AsIsElementContent clause.

Regards,
VK.
Back to top
View user's profile Send private message
abhishekpreddy
PostPosted: Wed Aug 29, 2007 11:57 pm    Post subject: Reply with quote

Apprentice

Joined: 02 May 2007
Posts: 49

Hi VK,

Thanks for your responce but can you please eloborate , i am not clear what you mean by adding the XML asid element clause.

regards,
Abhishek
Back to top
View user's profile Send private message
abhishekpreddy
PostPosted: Thu Aug 30, 2007 12:06 am    Post subject: Reply with quote

Apprentice

Joined: 02 May 2007
Posts: 49

Hi VK,

There seems to be a problem with the Send Mail plugin , because if i try to send the data without wrapping the XML in CDATA , The email Body is Blank, nothing is displayed. I dont understand this behaviour and hence i am forced to wrap the data in CDATA before sending it to the plugin.


regards,
Abhishek
Back to top
View user's profile Send private message
dkeister
PostPosted: Thu Aug 30, 2007 9:59 am    Post subject: Reply with quote

Disciple

Joined: 25 Mar 2002
Posts: 184
Location: Purchase, New York

The reason you get an empty message if you only have xml in the body WITHOUT the CDATA is because the body (or line) has no element data. See the following:

1. <Body><Line><a>This is Good</a></Line></Body>

results in email body = empty because there is no content in <Line>

2. <Body><Line><![CDATA[<a>This is Good</a>]]></Line></Body>

results in email body = <a>This is Good</a>

3. <Body><Line>This is my line</Line></Body>

results in email body = This is my line

4. <Body><Line>This is my line<a>This is Good</a></Line></Body>

results in email body = This is my line

5. <Body><Line>This is my line<![CDATA[<a>This is Good</a>]]></Line></Body>

results in email body = This is my line<a>This is Good</a>

(Note: I haven't tried vk's XML.AsIsElementContent clause, but I'm never to old to learn!)
_________________
Dean Keister
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jsware
PostPosted: Fri Aug 31, 2007 5:12 am    Post subject: Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

dkeister wrote:
5. <Body><Line>This is my line<![CDATA[<a>This is Good</a>]]></Line></Body>

results in email body = This is my line<a>This is Good</a>
I learn't something today about SendMailPlugin (only element data in <Line> tags gets sent out, not sub-elements.

Would the following also produce the same?

Code:
set OutputRoot.XML.Message.Body.Line = 'This is my line<a>This is good</a>'


which would produce the following:

<Message><Body><Line>This is my line&lt;a&gt;This is good&lt;/a&gt;</Line></Body></Message>
_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
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 » Problem in Send Mail Plugin
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.