in reply to Re^2: Using Net::SMTP to send email attachments
in thread Using Net::SMTP to send email attachments

Hi,

I don't think its a "content-type" problem

I think the problem is you're using a very low level interface that needs to you know too much about MIME

Look at this example https://metacpan.org/pod/distribution/MIME-tools/examples/mimesender, this simple interface (MIME:Entity/Mail::Send) has been available since at least 1996

  • Comment on Re^3: Using Net::SMTP to send email attachments

Replies are listed 'Best First'.
Re^4: Using Net::SMTP to send email attachments
by astrobal (Acolyte) on May 01, 2017 at 05:46 UTC

    Hi there.

    Believe me, I like an easy life. I would not be trying to hand-craft this email script if there was a neater, simpler way.

    It has been written that there are 927 ways to send emails using Perl. MIME::Lite is a very nice example and I have used it (and still use it) very successfully. I use MIME::Lite to send the content of cgi forms to myself, at an email address which is local to the web server handling the form. The problem with 926 of these methods is that they were written 20 years ago, when spam was not the problem it is now and, email servers were happy to accept emails generated by non-local web servers. That is not the case today. What Net::SMTP does is to transfer the email to the local email server, from which it is then sent. That way the email is not then blocked by AOL and other email servers as not coming from an email server and so probably spam.

    The other problem is that only MIME::Lite of the MIME variants is available on the suite of Perl modules available at my ISP. They like an easy life too, so they will not allow me to install modules of uncertain provenance - even if they do come from CPAN - that may be a potential threat to the security of their systems. I could a few years ago, but - like with emails - the world has moved on. So, I am stuck with what I have.

    Thanks anyway for the suggestions...

      Hi there. Believe me, I like an easy life. I would not be trying to hand-craft this email script if there was a neater, simpler way.

      It has been written that there are 927 ways to send emails using Perl. MIME::Lite is a very nice example and I have used it (and still use it) very successfully. I use MIME::Lite to send the content of cgi forms to myself, at an email address which is local to the web server handling the form. The problem with 926 of these methods is that they were written 20 years ago, when spam was not the problem it is now and, email servers were happy to accept emails generated by non-local web servers. That is not the case today. What Net::SMTP does is to transfer the email to the local email server, from which it is then sent. That way the email is not then blocked by AOL and other email servers as not coming from an email server and so probably spam.

      In the time it has taken you to write that you could have tested the "Net::SMTP" back end of "mimesender" to verify that it does/can use Net::SMTP

      The other problem is that only MIME::Lite of the MIME variants is available on the suite of Perl modules available at my ISP. They like an easy life too, so they will not allow me to install modules of uncertain provenance - even if they do come from CPAN - that may be a potential threat to the security of their systems. I could a few years ago, but - like with emails - the world has moved on. So, I am stuck with what I have. Thanks anyway for the suggestions...

      In the time it has taken you to write that, you could have used "mimesender" to show you how your mime message is supposed to look exactly, no guessing

      Also, in the same time, you could have installed these pure-perl modules right next to your .cgis

      Yes, even you can use CPAN, A Guide to Installing Modules, Top 11 (GOOD) reasons not to use someone else's Modules, Top Seven (Bad) Reasons Not To Use Modules

        First problem is that MIME::Sender is not on the suite of Perl modules that my ISP provides.

        Second problem is that because I am a mean cheapskate, my website has shared hosting so I am not allowed to install any modules that I might want - or even need...