Author |
Message
|
abhishekpreddy |
Posted: Wed Aug 29, 2007 3:30 am Post subject: Problem in Send Mail Plugin |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Aug 29, 2007 3:56 am Post subject: |
|
|
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 |
|
 |
abhishekpreddy |
Posted: Wed Aug 29, 2007 4:03 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Aug 29, 2007 4:13 am Post subject: |
|
|
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 |
|
 |
vk |
Posted: Wed Aug 29, 2007 10:56 am Post subject: |
|
|
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 |
|
 |
abhishekpreddy |
Posted: Wed Aug 29, 2007 11:57 pm Post subject: |
|
|
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 |
|
 |
abhishekpreddy |
Posted: Thu Aug 30, 2007 12:06 am Post subject: |
|
|
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 |
|
 |
dkeister |
Posted: Thu Aug 30, 2007 9:59 am Post subject: |
|
|
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 |
|
 |
jsware |
Posted: Fri Aug 31, 2007 5:12 am Post subject: |
|
|
 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<a>This is good</a></Line></Body></Message> _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
|