NAME

Mail::Outlook::Message - extension to handle Microsoft (R) Outlook (R) mail messages.

SYNOPSIS

See Mail::Outlook, as this is not meant to be used as a standalone module.

DESCRIPTION

Handles the Message interaction with the Outlook API.

METHODS

new()

Create a new Outlook mail object. Returns the object on success or undef on failure. To see the last error use 'Win32::OLE->LastError();'.

Note that when displaying or sending a message, you MUST have completed the following fields:

To
Subject
Body

While the RFCs may let you send blank messages, it seems a rather pointless idea to me, and probably not what you intended. If you want to ignore this restriction, feel free to edit your copy of the source code and comment out or edit the appropriate line in _make_message().

create(%hash)

Creates a new message. Option hash table can be used.

display()

Creates a pre-populated New Message via Outlook. Returns 1 on success, 0 on failure.

send()

Sends the message. Returns 1 on success, 0 on failure.

delete_message()

Remove this message.

Accessor Methods

Basic Accessor Methods

The following basic accessor methods are available:

SenderName
To
Cc
Bcc
Subject
Body

All functions can be called to return the current value of the associated object variable, or be called with a parameter to set a new value for the object variable if you are creating a message.

From()

Returns the current settings for the read only From field. Note that this is not an email address when used in connection with a new message. Returns a list containing the Name and Address of the user.

Sent()

Returns the date/time the current message was sent. Note that this will return undef if the message has not been sent!

Received()

Returns the date/time the current message was received. Note that this will return undef if the message has not been sent!

XHeader($xheader,$value)

Adds a header in the style of 'X-Header' to the headers of the message. Returns undef if header cannot be added.

NOTE: Currently unimplemented, due to unreliable treatment by Exchange server.

Attach(@attachments)

Add attachments when creating a message. Returns the attachments of the message if no arguments are passed to the method.

CAVEATS

Due to some recent security patches within Outlook, Microsoft have disabled the automatic access to the Outlook OLE. As some spam and trojan scripts, as well as the usual executables, have been using the application for malicious uses, Microsoft have stepped in an attempt to block this. If these security patches have been applied, when the module accesses Outlook via the OLE, you will probably see one of the following messages, or something like them.

Security Message 1

When the module attempts to retrieve the From address, a warning message box may appear. The text will be along the lines of:

A program is trying to access e-mail addresses you have
stored in Outlook. Do you want to allow this?

If this is unexpected, it may be a virus and you should
choose "No".

[ ] Allow access for [ --------- V]

[Yes]  [No]  [Help]

The message informs you that an unknown application is accessing Outlook and asks whether you wish to allow this. Click 'Yes' to allow the script to access the Outlook Address Book. Or you can set a time period, during which the script can access the Outlook OLE.

Security Message 2

On sending the message, you may also activate another warning message box. The text will be along the lines of:

A program is trying to automatically send e-mail on
your behalf.
Do you want to allow this?

If this is unexpected, it may be a virus and you should
choose "No".

[Yes]  [No]  [Help]

Click 'Yes' to allow the script to automatically send the message via Outlook.

FURTHER READING

If you intend to supply a patch for a bug or new feature, please visit the following URL (and associated pages) to ensure you are using the correct objects and methods.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/html/olobjApplication.asp

This article contains some interesting background into creating mail messages via Outlook, although it is VB-centric.

http://www.exchangeadmin.com/Articles/Index.cfm?ArticleID=4657

FUTURE ENHANCEMENTS

A couple of items that I'd like to get working.

* X-Header support * Send without the popups (Outlook Redemption looks possible)

NOTES

This module is intended to be used on Win32 platforms only, with Microsoft (R) Outlook (R) installed.

Microsoft and Outlook are registered trademarks and the copyright 1995-2003
of Microsoft Corporation.

SEE ALSO

Win32::OLE
Win32::OLE::Const

DSLIP

b - Beta testing
d - Developer
p - Perl-only
O - Object oriented
p - Standard-Perl: user may choose between GPL and Artistic

BUGS, PATCHES & FIXES

There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please submit a bug to the RT system (see link below). However, it would help greatly if you are able to pinpoint problems or even supply a patch.

Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me by sending an email to barbie@cpan.org .

RT: http://rt.cpan.org/Public/Dist/Display.html?Name=Mail-Outlook

AUTHOR

Barbie, <barbie@cpan.org>
for Miss Barbell Productions, <http://www.missbarbell.co.uk>

COPYRIGHT AND LICENSE

Copyright © 2003-2007 Barbie for Miss Barbell Productions.

This library is free software; you can redistribute it and/or modify it under
the same terms as Perl itself, using the Artistic License.

The full text of the licenses can be found in the Artistic file included with this distribution, or in perlartistic file as part of Perl installation, in the 5.8.1 release or later.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 487:

Non-ASCII character seen before =encoding in '©'. Assuming CP1252