use strict; use warnings; use Mail::Sendmail; my $xml = qq#<?xml version="1.0" encoding="windows-1252"?> <node id="972305" title="diamondsandperls" created="2012-05-24 15:58:2 +7" updated="0000-00-00 00:00:00"> <type id="15"> user</type> <author id="972305"> diamondsandperls</author> <data> <field name="doctext"> </field> <field name="lasttime"> 2013-04-30 16:51:07</field> <field name="experience"> 187</field> <field name="user_scratchpad"> 972306</field> <field name="imgsrc"> </field> <field name="timeformat"> </field> <field name="numwriteups"> 74</field> <field name="location"> </field> <field name="timezone"> </field> <field name="codewrapoff"> </field> <field name="codewraplength"> </field> <field name="codeautowrap"> </field> <field name="codeprefix"> </field> <field name="codebig"> </field> </data> </node> #; my %mail = ( 'To' => 'bill@microsoft.com', 'From' => 'diamondsandperls@perlmonks.org', 'Subject' => 'Some XML', 'Content-Type' => 'application/xml', 'Message' => $xml ); sendmail (%mail) or die $Mail::Sendmail::error; exit;

That should post your XML data nicely.


In reply to Re: posting xml data by hippo
in thread posting xml data by diamondsandperls

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.