Dear monks,

I use this below cgi form after submitting the mail entry detail form. Here, if only send message means it properly sending no problem. If i use attachments in the form also it sending from my local system cgi file. I use this cgi files in the my webserver and i attached the attachment in the local server means it's not working. How can i change the code please provide.

#!/usr/bin/perl + use CGI qw(:standard); use MIME::Lite; + my $q = CGI->new; + print $q->header; + print $q->start_html(-title=>"second document"); + my $from = $q->param('textfield1'); my $to = $q->param('textfield2'); my $cc = $q->param('textfield3'); my $bcc = $q->param('textfield4'); my $subject = $q->param('textfield5'); my $data = $q->param('textarea1'); + + $msg = MIME::Lite->new( + From => $from, + To => $to, + Cc => $cc, + Bcc => $bcc, + Subject => $subject, + Data => $data + ); + $msg->attach( Type => "AUTO", Path => "/home/test/perl.ppt", Filename => "perl.ppt" + ); + $msg->send; + print "Mail has been send to $to OK"; + print $q->end_html;

In reply to How to attach the attachments? by gube

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.