views:

36

answers:

1

I'd like to format messages that I send using the Mail::Outlook.For e.g. change the font size or make it bold etc. How do I do this?

+2  A: 

It appears that the 'message' member of a Mail::Outlook::Message is just a MailItem object. If you want to reach in, you could just manipulate it. From the doc I'm looking at, you would set the BodyFormat and HTMLBody properties.

So say that $outlook is your Mail::Outlook instance. It might work to do this:

use Win32::OLE::Const 'Microsoft Outlook';

$message   = $outlook->create();
$mail_item = $message->{message};
$mail_item->{BodyFormat} = olFormatHTML
$mail_item->{HTMLBody}   = <<END_HTML;  
<HTML><H2>The body of this message will appear in HTML.</H2>
<BODY>Type <b>something bold</b> here. </BODY>
</HTML>
END_HTML
Axeman