Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

how can send an email with attachment from an html form

by Anonymous Monk
on Nov 29, 2002 at 06:40 UTC ( #216429=perlquestion: print w/replies, xml ) Need Help??

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

How can i send an email with attachment from an html form. Can any body give me the perl code and html form to do this
  • Comment on how can send an email with attachment from an html form

Replies are listed 'Best First'.
Re: how can send an email with attachment from an html form
by ph0enix (Friar) on Nov 29, 2002 at 09:36 UTC

    Email must be send directly from form? Your browser must be properly configured - main problem

    <form action='mailto:address@somewhere.com' method='post' name='myfrm' + enctype='multipart/form-data'> <input type='file' name='file1'> <input type='submit' name='submit' value='send email'> </form>

    I suggest to use perl script on server side.Web servers are usually properly configured, but web browsers not...

    <form action='emailsend.pl' method='post' name='myfrm' enctype='multip +art/form-data'> ...

    For simple sending email with attachement is usable high level module Mail::Sender

Re: how can send an email with attachment from an html form
by Anonymous Monk on Feb 17, 2020 at 21:22 UTC
    This is exactly what I'm looking for, but it's not working on my site. Where do I place the 2nd part of this code?

      This thread is very old. I'd suggest looking at MIME::Lite for your email sending needs.

        Um, from the doc for MIME::Lite (for several years now):

        MIME::Lite is not recommended by its current maintainer. There are a number of alternatives, like Email::MIME or MIME::Entity and Email::Sender, which you should probably use instead. MIME::Lite continues to accrue weird bug reports, and it is not receiving a large amount of refactoring due to the availability of better alternatives. Please consider using something else.


        The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://216429]
Approved by rob_au
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2020-10-27 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (257 votes). Check out past polls.

    Notices?