nnigam has asked for the wisdom of the Perl Monks concerning the following question:

I am using mime::lite to send emails with 4 attachments. The script has been working successfully for some time. However, now it has stopped working with the only change that I can notice is that the attachment size is now about 15mb. If I remove the largest file, it again works perfectly. Is there any error feature in mime::lite that will tell the smtp responss to see why mail is not being sent. I tried the following $res_str=MIME::Lite->send('smtp','mailsrv',Timeout=>60); $res_str=$msg->send; The first res_str is 2, the second is 1 which to means success in both. Does mime::lite have any size restrictionis? Mail by directly attaching the documents to a mail messages works perfectly so I assume it is not a gatway size restriction.

Replies are listed 'Best First'.
Re: mime::lite $msg->send erratic
by olivierp (Hermit) on Feb 09, 2005 at 23:12 UTC
    Are you sure it's not a restriction ?
    Your attachments may be under the gateway's limit taken piece by piece, but it may not be the case when you attach all of them.
    Replace the server & domain parts below, and have a look.
    #!/usr/bin/perl -w use strict; use Net::SMTP; use IO::Scalar; my $smtp; my $debug = ''; tie *STDERR, 'IO::Scalar', \$debug; $smtp = Net::SMTP->new('your.smtp.server', Hello => 'a.domain.it.accepts', Timeout => 30, Debug => 1, ); $smtp->quit(); untie *STDERR; print grep {/SIZE/} (split(/\n/,$debug));
    Note: the STDERR redirection comes from this node, and if you look at MIME::Lite's docs, you'll notice MIME::Lite->send accepts a "sub" facility, where you could plug a variant of the snippet, to "enable" debugging. Take a look at send_by_smtp's source for further inspiration on how to do it.
    Update: Actually, calling MIME::Lite->send_by_smtp with Debug => 1 as part of it's args may be simpler (haven't tried)
    HTH
    --
    Olivier
      Thanks for the tip. I did not have Scaler installed. I will install this as it seems very useful, but adding the debug option finally gave me the message that it is indeed the gateway limitation. Thanks