sgmansell has asked for the wisdom of the Perl Monks concerning the following question:
Hello Perl Monks
I have multiple files I want to send to multiple emails. One file goes to one email recipient. I have StrawberryPerl 5.20.1.1 (64bit) on Windows 7 (64 bit). I have Mail::Sender installed. I copied the following code from, actually, I've looked at so many sites I forget where I copied it from. SMTP, To and From are real and will be used for my testing purposes.
#!/usr/local/bin/perl -w use Mail::Sender; $sender = {}; if ($sender->MailMsg({ smtp => 'ECMAIL7.internal.lacoe.edu', from => 'mansell_steven@lacoe.edu', to =>'sgmansell@gmail.com', subject => 'this is a test', msg => "Hi Steve.\nHow are you?" }) < 0) { print "if must be less than 0\n"; die "$Mail::Sender::Error\n"; } print "Mail sent OK."
I get this error
Can't call method "MailMsg" on unblessed reference at email_code.pl line 5.
I am not familiar with methods so I'm not sure what to do at this point.
1. Is there a way to send email without using methods? or do I need to learn methods?
2. Is there a way to test if I'm able to send an email through the Exchange server?
Thanks,
Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: email through Exchange server using StrawberryPerl
by roboticus (Chancellor) on Sep 30, 2014 at 18:56 UTC | |
by sgmansell (Initiate) on Sep 30, 2014 at 19:07 UTC | |
by soonix (Chancellor) on Sep 30, 2014 at 21:58 UTC | |
by sgmansell (Initiate) on Oct 01, 2014 at 18:15 UTC | |
by soonix (Chancellor) on Oct 02, 2014 at 15:59 UTC | |
by roboticus (Chancellor) on Oct 01, 2014 at 00:04 UTC |