Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


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 04: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

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unable to send attachment using mailx command

I am unable to send email with attachment using the mailx command. Without the attachment, the email goes through file. This is the command I use. Works : $ echo "Test" | mailx -s "Test" username@website.com Fails : $echo "Test" | mailx -a all-dss-accounts.txt -s "Test"... (3 Replies)
Discussion started by: nkarthik_mnnit
3 Replies

2. Shell Programming and Scripting

How to send email HTML + PDF attachment?

I am attempting to write a script where I can pass in parameters ( to , from, the location of a pdf attachment ) and send an email that has HTML for the body content and a PDF as an attachment. I have failed to achieve this with sendmail and mutt. I recently found this. If there are any... (2 Replies)
Discussion started by: jvsrvcs
2 Replies

3. Shell Programming and Scripting

Unable to send mail with inline html along with attachment. Please help!

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... (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

4. UNIX for Advanced & Expert Users

How to send email as HTML format with attachment ?

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... (4 Replies)
Discussion started by: bh_hensem
4 Replies

5. Shell Programming and Scripting

Unable to see attachment in outlook express sent by UUENCODE through unix script

Hi, I have written one script to send mail with attachment from my unix server, it is working fine, and i am capable to see the attachment in my lotus notes , but when i try to see the same thing in my outlook express ..it is completly garbaled. Please advise how to see proper attachment in... (5 Replies)
Discussion started by: apskaushik
5 Replies

6. Red Hat

Send HTML body and HTML attachment using MUTT command

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.. (2 Replies)
Discussion started by: vickramshetty
2 Replies

7. Shell Programming and Scripting

unable to send an email attachment

i know its pretty repeated query, but i need to post it in this new thread coz i need it urgently uuencode /var/tmp/chandra/emaillist.txt emaillist.txt | mail -s "message with encoded attachment" am unable to send the attachment emaillist.txt present in the path /var/tmp/chandra/ Is... (11 Replies)
Discussion started by: cmaroju
11 Replies

8. AIX

Command line/Script to send E-mail with HTML body and binary attachment

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... (3 Replies)
Discussion started by: G-Man
3 Replies

9. Shell Programming and Scripting

Send an attachment and html text both in the same mail

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... (4 Replies)
Discussion started by: stefan.yu
4 Replies

10. Shell Programming and Scripting

UNABLE to send 5MB attachment using mailx

hi, i've created a script that sends out an email using the mailx and uuencode command. the script is ok, but when a 5MB attachment is sent, there are time that the intended recepients does not receive any email. i tested it and the issue is intermitent. please help on how to troubleshoot. i... (3 Replies)
Discussion started by: tads98
3 Replies

Featured Tech Videos