简体   繁体   中英

Sending mail Body and attachment using mailx - Linux

mailx -a 'Content-Type: text/html' -s "Body" < index.html "foo@example.com"

I'm trying to send an email using mailx command line.The above command is working fine to send body as html file.
but along with it I also want to send an attachment. is it possible to send an attachment and body as a file together? How to do it

I found a solution using mutt here is the command

mutt -e "set content_type=text/html" -s "Your subject" to@domain.com -a attachfile.txt < index.html

index.html The content in this file will be printed in the body of the mail -a You can attach any number of attachments

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM