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


I ended up finding my own solution to this one. Instead of using Mail::Outlook, I decided to use Win32::OLE and configure it to a new outlook application object. I don't know a lot about OLE, but the info. I found about interfacing it with Outlook was very useful: found here.

Basically, that allowed me to set two new message behaviors (objects? parameters?) via the following:

use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; 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'} = ''; $msg -> {'Subject'} = 'Important Subject Matter'; $msg -> {'BodyFormat'} = 'olFormatHTML'; $msg -> {'HTMLBody'} = 'Some text I want to display <a href=http://goo>With Links in HTML</a> embedded in that text\n' $msg -> Send();

So setting the 'BodyFormat' and 'HTMLBody' did the trick.

Original Problem

Howdy All,

So, I'm writing an automatic e-mail notification system for my office. We run Windows 7 and Outlook is the only e-mail program that I am aware of existing on our systems. I've been trying to use the Mail::Outlook module to send my e-mails. The problem is that I can't seem to find a way to insert hyperlinks into the e-mail, that display text other than the url. So if I want to insert a link to Google, I can just post:

$msg -> Body('')

However, if I want to link to Google and make it read as, "Search Engine," I'm not sure there's a way to do that. Other mailer modules seem to get around this by formatting the links in HTML. But I don't see a way to format the message as HTML using this module. Does anyone know if there is a way to do that?

If not, does anyone have any suggestions on better e-mail modules for use with a Windows 7 system? (Most of the modules I've found send e-mails using the sendmail folder on Linux boxes. I don't know how to mimic that functionality on Windows boxes).

Brady C. Jackson