Method 1: send a single attachment (Garbled text)
Mutt-s "mail subject"-A output_email.html -- tomail@163.com<Output_email.html
Or
Cat output_email.html |Mutt-s "mail subject"-A output_email.html -- tomail@163.com
Effect:
Email body garbled
Method 2: send multiple attachments (without Garbled text)
#! /Bin/sh </P> <p> from = 'anghang @ fruitsmobile.com '<br/> to = 'anghang _ 2050@163.com' </P> <p> email_date ='' <br/> email_subject = 'subjest '<br/> email_content = ". /folder/file "<br/> email_attach = ". /folder/file. /folder/file2. /folder/file3. /folder/file4 "</P> <p> function send_email () {</P> <p> email_date = $ (Date "+ % Y-% m-% d _ % H: % m: % s ") <br/> email_subject = $ email_subject "_" $ email_date </P> <p> CAT $ email_content |/usr/bin/mutt-S $ email_subject-A $ email_attach- E 'set content_type = "text/html" '-e' My _ HDR from: '$ from -- $ to </P> <p >}</P> <p> send_email <br/>
:
Recommended websites:
Sending files as mail attachments
Sending email with attachments on UNIX systems
Linux automatically sends emails in HTML format with attachments