Curtis Leach wrote:
> Thanks to everyone who responded.
> 
> I ended up having to put the SMTP server name to use into a config file.
> Since I couldn't figure out a way to ask Windows/Outlook in Perl what it
> was configured to use.

Try something like:

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

my $OL = Win32::OLE->GetActiveObject('Outlook.Application') or
   Win32::OLE->new('Outlook.Application', 'Quit');
die 'GetActiveObject -> new failed' if not $OL; # try opening OE if you err here

my $NameSpace = $OL->GetNameSpace("MAPI");
my $EmailAddr = $NameSpace->{CurrentUser}{Address};
print "Email=$EmailAddr\n";

__END__
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to