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

I tried this script but I got an error message, "EOH" seems to be undefined here....?

What error message do you get?

And, is the email sent from the web server instead of being transferred to the email server?

The message is sent from the machine where the script runs. Whether it is sent directly or transferred to the mail exchanger of this machine's domain depends on your mail configuration.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
  • Comment on Re^5: Using Net::SMTP to send email attachments

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

    The error message is this:

    "Can't call method "datasend" on an undefined value at example2.cgi line 26, <> line 1."

    and line 26, line 1 was "$smtp->datasend(<<"EOH");"

    Thanks

    Geoffrey

      "Can't call method "datasend" on an undefined value at example2.cgi line 26, <> line 1."

      So it is not EOH, but $smtp which is not defined. Did you notice the ellipsis (...) in my example? These are placeholders for something that's been omitted for brevity, and you should add the bits needed, namely the initialization of $smtp and the protocol, and any other code to make that work.

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'