Operating System - HP-UX
1819951 Members
3330 Online
109607 Solutions
New Discussion юеВ

Re: Not able to mail message body & attachment together

 
praveen..
Super Advisor

Not able to mail message body & attachment together

Hi,
I am able to send message body:
# cat file_of_message_body | mailx -s "Test_Mail" someone@somewhere.com

I am also able to send an attachment:
# ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com


But i want to send message body & attachment together in a mail, so i tried:

# ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com < file_for_email_message_body

and

# cat file_for_email_message_body
| ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com

But I am not getting the attachment using above command,

Please suggest sothat I can get the email message body & attachment together.

Thanks

6 REPLIES 6
spex
Honored Contributor

Re: Not able to mail message body & attachment together

Hi praveen,

Try this:

( cat file_of_message_body
ux2dos /path_to/some_file | uuencode some_file.txt some_file.txt
) | mailx -s "Test_Mail" someone@somewhere.com

PCS
Steven E. Protter
Exalted Contributor

Re: Not able to mail message body & attachment together

Shalom,

http://www.hpux.ws/mailfile2

Its got a body.

Its got an attachment.

To me its kinda cute. LOL.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dave La Mar
Honored Contributor

Re: Not able to mail message body & attachment together

Praveen -
There are a number of examples in the attached, including multiple attachments with body, etc.

Regards,

-dl
"I'm not dumb. I just have a command of thoroughly useless information."
Sandman!
Honored Contributor

Re: Not able to mail message body & attachment together

try this:

uuencode file.txt file.txt | echo "hi praveen,\n\ntest email with body and attachment.\n\nregards" | mailx -m -s "test email" abc@xyz.com
praveen..
Super Advisor

Re: Not able to mail message body & attachment together

Hi,
I tried with all of these...

# ( cat file_of_message_body | ux2dos /path_to/some_file | uuencode some_file.txt some_file.txt
) | mailx -s "Test_Mail" someone@somewhere.com

and

# ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com < file_for_email_message_body

and

# uuencode file.txt file.txt | echo "hi praveen,\n\ntest email with body and attachment.\n\nregards" | mailx -m -s "test email" abc@xyz.com


and using the above commands, I am getting message body but not getting the attachment.

Please suggest..



Hi SEP...
can you please tell me how to use...
http://www.hpux.ws/mailfile2

praveen..
Super Advisor

Re: Not able to mail message body & attachment together

Thanks

I am able to send mail message body & attachment together using http://www.hpux.ws/mailfile2