Hi,

I'm a perl developer. I need to attach a word document file from my perl cgi script and send mail to our users whoever using our website. I have used mailx command to attach a file. There are no library(MIME::Lite, Mail::Sender, Mail::Mailer) available in my server. That's why I'm using the inbuilt mailx command to send mails. It is sending mails, but the problem I'm facing is I'm not getting body of the mail. I'm getting attachment only. Body message is not getting delivered.

I have a function called sendmailto which sends email to users. Can any one help me to get the body of mail too..

Function Code: sub sendmailto { $mailing_list = $_[0]; $subject = $_[1]; $message = $_[2]; $from = "naga.rajan@gmail.com" open (MAIL, "|uuencode /home/naga/testing-scripts/Package_Spec +ification_Document.doc Package_Specification_Document.doc |mailx -s \ +"$subject\" -r $from $mailing_list"); print MAIL "Hi, \n"; print MAIL "\n"; print MAIL "This email was sent using an automated email syste +m. Please do not reply, or forward to this email otherwise your messa +ge will not reach your intended recipients. \n"; print MAIL "If you like to contact us pleas write to *UNIX Tea +m. \n"; print MAIL "\n"; print MAIL "Regards, \n"; print MAIL "UNIX Team \n"; print MAIL "\n"; print MAIL "\n"; print MAIL "$message"; close MAIL; }
My OS details: uname -a SunOS testingserver 5.10 Generic_147440-19 sun4v sparc SUNW,T5440 perl --version This is perl, v5.8.4 built for sun4-solaris-64int (with 35 registered patches, see perl -V for more detail)

Please help me, how can we achieve this using mailx function? Installing library is a big task.. so I don't want to go for library installation.. Wanted to achieve this with built-in features available in this version of perl...

Thanks in Advance.. Nagarajan

In reply to body content is missing while sending mail with attachment by bheeshmaraja

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.