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

Does anyone know why my Net::SMTP emailing dies when message size exceeds 8k? I don't have any specific code, and my "Debug=>1" option doesn't output any extra data.

Thanks,

J. J. Horner 
CISSP,CCNA,CHSS,CHP,blah,blah,blah

Title edit by tye

Replies are listed 'Best First'.
Re: Net::SMTP 8kB message size limit?
by Elian (Parson) on Jul 22, 2003 at 20:02 UTC
    I've sent multi-megabyte files with Net::SMTP--it does work. There are a couple of places you can hit a problem:

    The SMTP protocol does put a limit on line length. Lines generally shouldn't exceed 255 characters. (Don't have the standard handy. It might be as high as 1024, but I wouldn't go that high. If your lines are longer, use an encoding to make them shorter. (Quoted-printable's good for this)

    Mail is not a binary protocol. Transmitting characters outside the ASCII printable range is a dangerous and unsafe thing. If you have to go in excess of ASCII 127, or below ASCII 32, encode the data. BASE-64 or uuencoding works reasonably well here, or quoted-printable if its only a few characters.

    Lines can't start with a period, though Net::SMTP takes care of this, IIRC. That might be your problem. (Once again, MIME encode. Or double-up the period)

Re: Net::SMTP 8kB message size limit?
by demerphq (Chancellor) on Jul 22, 2003 at 22:45 UTC

    On the SMTP servers that I administer there is a config setting for maximum mail size. Id look there. Ive sent 10MB through Net::SMTP in the past so I doubt thats your problem


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...
Re: Net::SMTP 8kB message size limit?
by phydeauxarff (Priest) on Jul 22, 2003 at 19:17 UTC
    I just confirmed that I can send a 10k message using Net::SMTP.

    Can you provide some more information such as your operating system, and some code?

    Without any more info, the only thing I can think of is that the mailserver may be refusing it, but that is an awfully small limit so I would be flabergasted if that was the cause.