MAPI.Session

M

Maitre Bart

I am trying to replicate (at least the beginning of) the example given
at:

http://aspn.activestate.com/ASPN/do...Winfaq9.html#Is_there_a_way_to_access_MAPI_fr

where a code sample is provided to send an email with a Perl script
running on Windows XP using the Win32::OLE module:

# Sender's Name and Password
#
my $sender = "YOUR NAME HERE";
my $passwd = "YOUR PASSWORD HERE";

# Create a new MAPI Session
#
use Win32::OLE;
$session = Win32::OLE->new("MAPI.Session")
or die "Could not create a new MAPI Session: $!";
[...]

In my case I want to browse the Inbox folder and find a message with a
specific subject. However, I can't pass the session creation line: I
always get a undefined ref from the call (and die follows). Anyone
experienced this before?

(Looking at the threads that discussed this subject, it looks like they
are 4-5 years old... I wonder if there is another approach or if
MAPI.Session is still the way to go but I'm doing something wrong with
it?)
 
T

Thrill5

Maitre Bart said:
I am trying to replicate (at least the beginning of) the example given
at:

http://aspn.activestate.com/ASPN/do...Winfaq9.html#Is_there_a_way_to_access_MAPI_fr

where a code sample is provided to send an email with a Perl script
running on Windows XP using the Win32::OLE module:

# Sender's Name and Password
#
my $sender = "YOUR NAME HERE";
my $passwd = "YOUR PASSWORD HERE";

# Create a new MAPI Session
#
use Win32::OLE;
$session = Win32::OLE->new("MAPI.Session")
or die "Could not create a new MAPI Session: $!";
[...]

In my case I want to browse the Inbox folder and find a message with a
specific subject. However, I can't pass the session creation line: I
always get a undefined ref from the call (and die follows). Anyone
experienced this before?

(Looking at the threads that discussed this subject, it looks like they
are 4-5 years old... I wonder if there is another approach or if
MAPI.Session is still the way to go but I'm doing something wrong with
it?)

What e-mail system are you trying to access? Using MAPI with mail
applications other than Outlook does not work as you would expect. With
Groupwise, the MAPI logon name is not the logon name at all, but the name
of the profile you want to use for the session. You can verify that MAPI
works on your system by using any Office application and select File->Send
To->Mail Recipient. MAPI is configured in Control Panel under "Mail".

Scott
 
M

Maitre Bart

Thrill5 said:
What e-mail system are you trying to access? Using MAPI with mail
applications other than Outlook does not work as you would expect. With
Groupwise, the MAPI logon name is not the logon name at all, but the name
of the profile you want to use for the session. You can verify that MAPI
works on your system by using any Office application and select File->Send
To->Mail Recipient. MAPI is configured in Control Panel under "Mail".

Yes, I am used to send Office documents by email using this technique:
it uses Outlook.
So I guess I have to create a 'Outlook.Application' instead of a
'MAPI.session' with Win32::OLE ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,055
Members
47,659
Latest member
salragu

Latest Threads

Top