Bullock, Howard A. wrote:
> No, I did not try that. That method (last_send_successful) is not shown
> in my local MIME::Lite docs, but I did find it mentioned on CPAN. The
> CPAN docs state: After sending, the method last_send_successful() can
> be used to determine if the send was successful or
Bullock, Howard A. wrote:
>>Can't locate object method "last_send_successful" via package
>>"MIME::Lite" at ReplWatcherCroakTest.pl line 169.
>
>
> I see that I have version 3.01 from the ActiveState repository and that
> the version on CPAN is now 3.01_05. I do not plan on upgrading until a
> n
>Can't locate object method "last_send_successful" via package
>"MIME::Lite" at ReplWatcherCroakTest.pl line 169.
I see that I have version 3.01 from the ActiveState repository and that
the version on CPAN is now 3.01_05. I do not plan on upgrading until a
newer version is available via ppm from t
>Did you try the below as a success test ? :
>if ($msg->last_send_successful) {
> print "message successful\n";
>} else {
> print "message not successful\n";
>}
No, I did not try that. That method (last_send_successful) is not shown
in my local MIME::Lite docs, but I did find it menti
Bullock, Howard A. wrote:
> I have stripped my PerlSvc program to a minimal MIME::Lite email
> program. Using a firewall I blocked access to the mailhost and tested
> the "eval" code as both of you suggested and then using an "if" block to
> check [EMAIL PROTECTED]
>
> The "croak" was indeed trap
I have stripped my PerlSvc program to a minimal MIME::Lite email
program. Using a firewall I blocked access to the mailhost and tested
the "eval" code as both of you suggested and then using an "if" block to
check [EMAIL PROTECTED]
The "croak" was indeed trapped using the syntax:
eval {$msg-
Sisyphus wrote:
> For me that prints:
>
> foo didn't fail on '-1'
> foo didn't fail on '1'
> foo failed on '0':
> foo failed on '':
> foo failed on 'die': I Died at try.pl line 10.
Me too.
> That's exactly what I expected it to produce ... so I guess we must be in
> agreement :-)
Good - it pr
- Original Message -
From: "$Bill Luebkert" <[EMAIL PROTECTED]>
.
.
>
> This is more of what I had in mind as a test which proves my point
> that a proper true returning call would work :
>
> foreach (-1, 1, 0, undef, 'die') {
> if (eval { foo ($_) } ) {
> print "foo didn't fail on '$_'\n
Sisyphus wrote:
> Yes ... I'm not too sure about this. He might be ok in this instance iff
> '$msg->send' returns something that evaluates as true.
That was my assumption, but further research shows that the problem is
that send doesn't really have a proper return if I read the docs and
code righ
- Original Message -
From: "$Bill Luebkert" <[EMAIL PROTECTED]>
To: "perl-win32-users"
Sent: Tuesday, September 12, 2006 5:18 PM
Subject: Re: Trapping Carp::croak
> Sisyphus wrote:
>
> > Yes, I think you used eval() improperly. You probably want
Sisyphus wrote:
> Yes, I think you used eval() improperly. You probably wanted:
>
> eval {$msg->send};
> if (!$@) {
> print "message sent\n";
> }
> else {
> print "Failed to send: [EMAIL PROTECTED]";
> }
Further qualifying, I think his is the equivalent of doing :
my $ret;
eval {
Sisyphus wrote:
> Yes, I think you used eval() improperly. You probably wanted:
>
> eval {$msg->send};
> if (!$@) {
> print "message sent\n";
> }
> else {
> print "Failed to send: [EMAIL PROTECTED]";
> }
While I would agree that your (and my) method work properly, I
believe there's
- Original Message -
From: "Bullock, Howard A."
.
.
> I tried to trap this issue in my code using "eval", but was
> unsuccessful.
>
> if (eval {$msg->send}) {
> print "message sent\n";
> }
> else {
> print "Failed to send: [EMAIL PROTECTED]";
> }
>
> Did I use the eval improperl
> [Bill Wrote:]
> I added 'use MIME::Lite;' (and dropped the Net::SMTP), used code I
knew
> to work with it and reversed your eval if testing $@ rather than the
> return code from send (although that last item may work either way).
>
> [Bullock, Howard A.]
> I used MIME::Lite as stated in the
Bullock, Howard A. wrote:
> [Bill Wrote:]
> I added 'use MIME::Lite;' (and dropped the Net::SMTP), used code I knew
> to work with it and reversed your eval if testing $@ rather than the
> return code from send (although that last item may work either way).
>
> [Bullock, Howard A.]
> I used MIME
[Bill Wrote:]
I added 'use MIME::Lite;' (and dropped the Net::SMTP), used code I knew
to work with it and reversed your eval if testing $@ rather than the
return code from send (although that last item may work either way).
[Bullock, Howard A.]
I used MIME::Lite as stated in the original post. T
Bullock, Howard A. wrote:
> [Bullock, Howard A.]
> What is different about your code other than not placing the "eval" in
> an "if" block? Is the missing semi-colon in the eval block the issue?
I added 'use MIME::Lite;' (and dropped the Net::SMTP), used code I knew
to work with it and reversed
> I tried to trap this issue in my code using "eval", but was
> unsuccessful.
>
> if (eval {$msg->send}) {
> print "message sent\n";
> }
> else {
> print "Failed to send: [EMAIL PROTECTED]";
> }
>
> Did I use the eval improperly or is there a better to prevent the
> stopping of my proces
Bullock, Howard A. wrote:
> I use MIME::Lite for sending email from my programs. If the mail server
> can not be contacted the following MIME::Lite code causes a fatal error
> aborting my process.
>
> ### Create SMTP client:
> require Net::SMTP;
> my $smtp = MIME::Lite::SMTP->new(@args)
> or C
19 matches
Mail list logo