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| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |