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

Hello. the emails are being generated using a mime file built using MIME::Lite with a PDF attachment. These emails are currently being sent out successfully with Net::SMTP; I was trying to use Net::SMTP::TLS and the email message is sent.. But the attachments are not being sent. Instead of the correct attachment, I'm getting multiple copies of the email message as attachments. Should the MIME File be generated with a different package or a specific version of MIME::Lite? Thanks in advance.

Replies are listed 'Best First'.
Re: Net::SMTP::TLS attachments
by Athanasius (Archbishop) on Aug 01, 2017 at 03:12 UTC

    Hello bdegan2, and welcome to the Monastery!

    These emails are currently being sent out successfully with Net::SMTP; I was trying to use Net::SMTP::TLS...

    From the documentation, it appears that Net::SMTP::TLS is no longer needed. has another module, Net::SMTP::TLS::ButMaintained, which is 7 years more up-to-date, but that module is deprecated in favour of Net::SMTPS. But the documentation for Net::SMTPS says:

    As of Version 3.10 of Net::SMTP(libnet) includes SSL/STARTTLS capabilities, so this wrapper module's significance disappareing. (sic)

    And the documentation of Net::SMTP 3.10 says:

    With IO::Socket::SSL installed it also provides support for implicit and explicit TLS encryption, i.e. SMTPS or SMTP+STARTTLS.

    So, if you install IO::Socket::SSL and upgrade Net::SMTP to 3.10 (the latest version), you can forget about Net::SMTP::TLS.

    Hope that helps,

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

      Thank you for this info. Yes, we are on Net::SMTP verison 2.29. So I'll get it upgraded and go that route. Thanks again.
Re: Net::SMTP::TLS attachments
by bdegan2 (Sexton) on Aug 08, 2017 at 19:58 UTC
    Hello, I have the updated Net::SMTP working with version 3.10 ... :) I have the results of the connection. It looks like I am sending out the STARTTLS and wanted to get your opinion that I did connect using TLS ?? Here is the debug:
    Net::SMTP>>> Net::SMTP(3.10)
    Net::SMTP>>> Net::Cmd(3.10)
    Net::SMTP>>> Exporter(5.58)
    Net::SMTP>>> IO::Socket::INET(1.31)
    Net::SMTP>>> IO::Socket(1.31)
    Net::SMTP>>> IO::Handle(1.28)
    Net::SMTP=GLOB(0x83f812c)<<< 220 rs-ord-mtsp-mta02-in2.int.smtp.com ESMTP (SMTP.com v6)
    Net::SMTP=GLOB(0x83f812c)>>> EHLO oh01lx03.workflowone.net
    Net::SMTP=GLOB(0x83f812c)<<< 250-rs-ord-mtsp-mta02-in2 says EHLO to 198.187.174.15:46786
    Net::SMTP=GLOB(0x83f812c)<<< 250-AUTH=CRAM-MD5 LOGIN PLAIN
    Net::SMTP=GLOB(0x83f812c)<<< 250-AUTH CRAM-MD5 LOGIN PLAIN
    Net::SMTP=GLOB(0x83f812c)<<< 250-STARTTLS
    Net::SMTP=GLOB(0x83f812c)<<< 250-8BITMIME
    Net::SMTP=GLOB(0x83f812c)<<< 250-ENHANCEDSTATUSCODES
    Net::SMTP=GLOB(0x83f812c)<<< 250 PIPELINING
    Net::SMTP=GLOB(0x83f812c)>>> STARTTLS
    Net::SMTP=GLOB(0x83f812c)<<< 220 2.0.0 continue
    Net::SMTP::_SSL=GLOB(0x83f812c)>>> EHLO oh01lx03.workflowone.net
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< 250-rs-ord-mtsp-mta02-in2 says EHLO to 198.187.174.15:46786
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< 250-ENHANCEDSTATUSCODES
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< 250-PIPELINING
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< 250-8BITMIME
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< 250-AUTH=CRAM-MD5 LOGIN PLAIN
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< 250 AUTH CRAM-MD5 LOGIN PLAIN
    Net::SMTP::_SSL=GLOB(0x83f812c)>>> AUTH CRAM-MD5
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< 334 PDIwMDI0NjMzLjE1MDIyMjE0NTlAcnMtb3JkLW10c3AtbXRhMDItaW4yPg==
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< (decoded) <20024633.1502221459@rs-ord-mtsp-mta02-in2>
    Net::SMTP::_SSL=GLOB(0x83f812c)>>> (decoded) SencoBrands 79ea0fef2dad01e3eafd5ad71103f681
    Net::SMTP::_SSL=GLOB(0x83f812c)>>> U2VuY29CcmFuZHMgNzllYTBmZWYyZGFkMDFlM2VhZmQ1YWQ3MTEwM2Y2ODE=
    Net::SMTP::_SSL=GLOB(0x83f812c)<<< 235 2.0.0 Authed. Go on.
    thanks again for your help with all this.