Results 1 to 2 of 2

Thread: Sendmail with header and footer logo in HTML body

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default Sendmail with header and footer logo in HTML body

    Hello,

    I need help with my script that will send email via sendmail
    command that will shows both the header and footer logo once the recepient
    receive the email (e.g. MS Outlook). When I tested to ran the script it will
    successfully send the email BUT UNFORTUNATELY it doesn't displayed the logos as
    expected to its proper location. What shows was there's NO logo showed up in the Header location, and
    the logo showed up in the Footer location was the header logo
    image.

    Below are the scripts, thusly:

    *** In my sendTest.sh
    ***

    Code:
    #!/bin/bash
    DIR=/var/images
    export MAILTO=""
    export SUBJECT="Test sendmail html format with logo both header and footer"
    export BODY="/var/www/testcid.html"
    export MAILPART=`uuidgen` # ***this will gen mailpart  unique id
    export MAILPART_BODY=`uuidgen` # ***this will gen mailpart_body id
    export ATTACH="$DIR/headerLOGO.jpg"
    export ATTACH1="$DIR/footerLOGO.jpg"
    (
    echo "To: $MAILTO"
    echo "Subject: $SUBJECT"
    echo "MIME-Version: 1.0"
    echo "Content-Type: multipart/mixed; boundary=\"$MAILPART\""
    echo ""
    echo "--$MAILPART"
    echo "Content-Type: multipart/alternative; boundary=\"$MAILPART_BODY\""
    echo ""
    echo "--$MAILPART_BODY"
    echo "Content-Type: text/plain; charset=ISO-8859-1"
    echo "You need to enable HTML option for email"
    echo "--$MAILPART_BODY"
    # echo "Content-Type: text/html; charset=ISO-8859-1"
    echo "Content-Type: text/html; charset=UTF-8"
    echo "Content-transfer-encoding: us-ascii"
    echo "Content-Disposition: inline"
    cat $BODY
    # echo "--$MAILPART_BODY--"
    echo "--$MAILPART"
    echo 'Content-Type: image/jpeg; name="'$(basename $ATTACH)'"'
    echo "Content-Transfer-Encoding: uuencode"
    echo 'Content-Disposition: attachment; filename="'$(basename $ATTACH)'"'
    echo ""
    echo "--$MAILPART"
    echo 'Content-Type: image/jpeg; name="'$(basename $ATTACH1)'"'
    echo "Content-Transfer-Encoding: uuencode"
    echo 'Content-Disposition: attachment; filename="'$(basename $ATTACH1)'"'
    echo ""
    
    (uuencode $ATTACH $(basename $ATTACH) && uuencode $ATTACH1 $(basename $ATTACH1))
    echo "--$MAILPART--"
    ) > catout.out
    cat catout.out | /usr/sbin/sendmail $MAILTO
    *** In my testcid.html ***

    HTML Code:
    <html>
    <head>
    <title>NOTIFICATION</title>
    </head>
    <body>
    <center>   <img border=1 src="cid:headerLOGO.jpg" alt=headerLogo />
    <p><h4>RE: xxxxx</h4></p>
      <p>abcdefghijlsfdklslslsls<br/>
         asdfewrsafsdfdsfs<br/></p>
      <p>Thank You.</p></td>
      <p>L</p>
    <center><img src="cid:footerLOGO.jpg" alt=footerLogo/></center>
    </center>
    </body>
    </html>
    Below are the actual email that I received when I ran the bash script as
    shown:

    receivedemail.jpg


    Image below should supposedly showed up in the footer location -

    footerLogo.jpg

    Do really appreciate your help for anyone could help me to investigate the scripts to make it work as expected.

    Thanks.

    Junix
    Attached Images Attached Images

  2. #2
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default Sendmail with header and footer logo in HTML body

    Hi,

    Anyone tried to figured out my posted issues.

    Help is very much appreciated. I'll just wait.

    Thank you.

    J

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Looks like this website stole your guys's Logo
    By Michael Pachter in forum The Hangout
    Replies: 1
    Last Post: 13th September 2012, 11:30 AM
  2. Replies: 2
    Last Post: 2nd March 2012, 11:48 PM
  3. Using header and body checks as profanity filter
    By primal23 in forum Mail Servers
    Replies: 3
    Last Post: 15th September 2009, 11:39 AM
  4. Sendmail block email based on Body / Words
    By asim.mcp in forum Mail Servers
    Replies: 1
    Last Post: 17th April 2009, 10:00 AM
  5. Tux: Linux Logo Penguin
    By ankur.chaudhary in forum Linux software
    Replies: 2
    Last Post: 27th September 2008, 01:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •