Steve_BZ has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I'm using Mail::Sender to send emails automatically from my application: it's a very nice little tool.
However I have a problem in that, depending on the setup (ie ISP/router), sometimes it works and sometimes the connection times out (Error connect() failed: Connection timed out. However other email clients do work.
I have extracted a bit of the code into a standalone application which reproduces the problem. However the debug file remains resolutely empty.
#!/usr/bin/perl -w use strict; use Mail::Sender; my $sender = new Mail::Sender { auth => 'PLAIN', authid => 'user', # Change this. authpwd => 'password', # Change this. smtp => 'smtpserver.mydomain.com', # Change this. from => 'user@mydomain.com', # Change this. to => 'foo.bar@yourdomain.com', # Change this. subject => 'test subject', msg => 'This is a text email', file => '/home/foo/bar/default.pdf', debug => "/home/foo/bar/SendMailDebug.txt", debug_level => 4, timeout => 500, }; my $result = $sender->MailFile({ msg => $sender->{msg}, file => $sender->{file}, }); print "$sender->{error_msg}\n>>>End.\n"; 1;
Am I using it right?
How can I get the debug function to give me something useful?
Any other ideas.
Regards
Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail::Sender Problems.
by flexvault (Monsignor) on Aug 09, 2012 at 10:28 UTC | |
|
Re: Mail::Sender Problems.
by zentara (Cardinal) on Aug 09, 2012 at 10:33 UTC | |
by flexvault (Monsignor) on Aug 09, 2012 at 10:49 UTC | |
by Steve_BZ (Chaplain) on Aug 09, 2012 at 11:48 UTC | |
by flexvault (Monsignor) on Aug 09, 2012 at 13:55 UTC | |
by Steve_BZ (Chaplain) on Aug 09, 2012 at 18:00 UTC | |
| |
by rpnoble419 (Pilgrim) on Aug 09, 2012 at 13:42 UTC | |
by Steve_BZ (Chaplain) on Aug 12, 2012 at 19:07 UTC | |
|
Re: Mail::Sender Problems.
by rpnoble419 (Pilgrim) on Aug 09, 2012 at 10:35 UTC |