I generate emails with Win32-OLE with the following code:
my $outlook = new Win32::OLE('Outlook.Application') or die "Could not +open Outlook Application!\n"; my $msg = $outlook -> CreateItem(0); unless ($msg){ die "Outlook is not running, cannot send mail.\n"; } $msg->{'To'} = 'test@test.com'; $msg->{'Subject'} = $vorlage_betreff; $msg->{'BodyFormat'} = 'olFormatHTML'; $msg->{'HTMLBody'} = $vorlage_body; // HTML Code read from file my $attach = $msg->{'Attachments'}; $attach->add('C:\\xxx.pdf'); $msg->Display();
This works fine but when i add Text to the displayed Email and press Return, it makes a p and not a br... T know that this is correkt because i selected HTML as Body Format and in HTML Return should be a p and not a br. When i click in outlook at "new mail" and write a text as HTML Mail, there is no space between the rows i changed with Return because i changed the preferences for the emailtemplate. The email generated with OLE has not the default template, so i searching a way to change this to the default.

In reply to Win32-OLE Outlook default template by kean

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.