Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: body content is missing while sending mail with attachment

by bheeshmaraja (Novice)
on Jul 30, 2012 at 13:44 UTC ( #984451=note: print w/replies, xml ) Need Help??


in reply to Re: body content is missing while sending mail with attachment
in thread body content is missing while sending mail with attachment

Thanks roboticus. I have modified my function and now I'm able to get both body message as well as attachment in mail. Function Code:
sub sendmailto { $mailing_list = $_[0]; $subject = $_[1]; $message = $_[2]; $from = "naga.rajan@gmail.com" $attachment = `uuencode "/home/naga/testing-scripts/Packa +ge_Specification_Document.doc" "Package_Specification_Document.doc" open (MAIL, "|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"; print MAIL $attachment; close MAIL; }
If I paste  print MAIL $attachment; next to mailx  open (MAIL, "|mailx -s "$subject\" -r $from $mailing_list"); then body content is getting missed. If we paste before closing MAIL file handler then we are able to get both body message as well as attachment in mail.

Replies are listed 'Best First'.
Re^3: body content is missing while sending mail with attachment
by Anonymous Monk on Oct 16, 2012 at 13:00 UTC

    @ uuencode is not in my meachine .Still i can use same meathod to send email attachment and message body ?

    .

      uuencode is not in my meachine .Still i can use same meathod to send email attachment and message body ?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984451]
help
Chatterbox?
[ww]: or a lot more than (22*2) for /me
[ww]: er -- senior cognitive deficiency: ((22+(22*2))
[ww]: (but pls don't s/senior/senile/ ... not yet
[karlgoethebier]: A bit more audience now: The Impact of Information Sources on Code Security Very interesting IMHO...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-09-25 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (280 votes). Check out past polls.

    Notices?