Unable to send attachment with html tables in UNIX shell script


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Unable to send attachment with html tables in UNIX shell script

Heyy,

any help would be grateful....

LOOKING FOR THE WAYS TO SEND AN EMAIL WITH ATTACHMENT & HTML TABLES IN BODY THROUGH SHELL SCRIPT (LINUX)..NOT SURE, IF WE HAVE ANY INBUILT HTML TAG OR UNIX COMMAND TO SEND THE ATTACHMENTS. KINDLY HELP

below is small script posted for our understanding..

key points:
1) I don't have mutt installed.
2) I do not want to read from a plain file to paste it in a body and send the attachments.

Code:
#!/bin/sh

SENDTO="sdcndsj@vfv.com"

    
                                                                      VERSION=1.0
                                    {
                                    echo "From:"
                                    echo "To: "
                                    echo "Cc: "
                                    echo "Subject:Alert- File watcher for xxxx locations !!"
                    echo "X-Mailer: htmlmail" $VERSION
                                    echo "Mime-Version: 1.0"
                                    echo "Content-Type: text/html; charset=US-ASCII"
                                        echo "<font size="1" face="Sylfaen">"
                                  echo "<html>"
                                    echo "<body>"


                                    echo "<font size="3" face="Sylfaen">Hi All,</font><br>" 
                                    echo "<br>"
                    echo "<font size="3" face="Sylfaen">Please find impacted files across all the inbound & outbound locations in sephora. Kindly do take
                                    required actions with respective to the scenario's .</font><br>" 
echo "YET TO CONSTRUCT TABLE HERE, Created TEMP script for our understanding"
                                                       
                                    echo "<br>"
                    echo "<font size="3" face="Sylfaen"><u>Script checks for below scenario's: </u></font><br>"
                    echo "<br>"
                    echo "<font size="3" face="Sylfaen">1)Inventory Inbound; 2) Image Inbound; 3) Order Return Inbound </font><br>"
                                    echo "<font size="3" face="Sylfaen">4)Purchase order Outbound; 5) PO Acknowledgement Inbound </font><br>"
                                    echo "<font size="3" face="Sylfaen">6)Shipping confirmation Inbound </font><br>"
                                    
                                    echo "<br>"
                                    echo "<font size="3" face="Sylfaen">Regards,</font><br>"
                                    echo "<font size="3" face="Sylfaen">DP team</font><br>"
                              
                                     echo "</body>"
                                     echo "</style>"
                                     echo "</html>"
                                     }  | | /usr/lib/sendmail -t $SENDTO

sleep 4

exit


Last edited by Scott; 02-27-2018 at 03:06 PM.. Reason: rudic: Added CODE tags; Scott: removed poll, moved thread
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Unable to send mail with inline html along with attachment. Please help!
thulasidharan2k
The below code is not working. I am able to send only inline html or only attachment. When trying to do both, only inline html is sent without attachment. Please help! #!/bin/ksh (echo "Subject: Test Mail - HTML Format" echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo...... Shell Programming and Scripting
1
Shell Programming and Scripting
How to send email as HTML format with attachment ?
bh_hensem
hi.. Could somebody help me how to sent an attachment using sendmail command and the content is HTML format ?. Below is my code to sent the email as HTML but i do not know how to sent the attachment, please help me To: "BAHARIN HASAN"<baharin.hasan@gmail.com> from: "DATAONE SDN...... UNIX for Advanced & Expert Users
4
UNIX for Advanced & Expert Users
Send HTML body and HTML attachment using MUTT command
vickramshetty
Hi there.. I need a proper "mutt" command to send a mail with html body and html attachment at a time. Also if possible let me know the other commands to do this task. Please help me..... Red Hat
2
Red Hat
Command line/Script to send E-mail with HTML body and binary attachment
G-Man
I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum: I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command...... AIX
3
AIX
Send an attachment and html text both in the same mail
stefan.yu
Hi all, I am working on UNIX (Solaris28). I would like to send an email in which the body will be in html format and, in the same mail, a xls file has to be attached. I have tried this: the file is correctly attached but the body comes as html source and not formatted. If I do not attach the...... Shell Programming and Scripting
4
Shell Programming and Scripting