kean has asked for the wisdom of the Perl Monks concerning the following question:

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.

Replies are listed 'Best First'.
Re: Win32-OLE Outlook default template
by kean (Sexton) on Dec 05, 2013 at 13:18 UTC
    This is a manual to change it:
    Go to your Inbox. Click on the New button in the upper left to start a new email. Click on the Format Text tab at the top of your screen. You’ll see the buttons are grayed out. Click in the big white box wher +e you’d write the body of your email to activate them. Click on the dialog box in the Paragraph group. The dialog box is loca +ted in the lower right-hand corner of the group. It looks like a tiny + arrow inside a square. In the section under “Spacing,” change the “Before” and “After” to zer +o. Change the Line Spacing to Single. Click on the Default button at the bottom of the box. Click OK in the box that pops up. Click OK to get out of the Paragraph dialog box.
    This i will do with Win32-OLE...