Sorry forgot. Before it would just send all the emails that were in a txt file, and since updating I still want to send from the same txt file but am getting the following error:
Can't call method "Messages" on an undefined value at P:\bin\SendEmail
+FromFileViaMAPIOutlook_v2.pl line 35, <IN> line 49. A thread exited w
+hile 2 threads were running, <IN> line 49.
| [reply] [d/l] |
# Create a new message
$msg = $session->Outbox->Messages->Add();
...so it seems that either $session is not shared (i.e. available in the thread )...or...$session->Outbox is not returning what you think with the new Outlook version
try:
print "$session, $session->Outbox\n";
$msg = $session->Outbox->Messages->Add();
.... some possible things to watch for?..... $session->Outbox is now returning an array or something different from the earlier version..... or the new Outlook isn't thread safe, or something
..... by the way, the code looks like complete crap as far as thread variable management goes.....you seem to rely on being able to make $session a global object, and hoping the global nature extends into the thread..... the fact it even worked earlier is surprising..... but i don't do win32....so i just observe
| [reply] [d/l] [select] |
my $session = Win32::OLE->new("MAPI.Session") or die "Failed to create
+ a MAPI Session: $!";
When I add the script you stated it prints out the following "Win32::OLE=HASH(0x225378), Win32::OLE=HASH(0x225378)->Outbox"
What would you recommend using besides Win32?
| [reply] [d/l] |