Difficulty to send image in mail body.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Difficulty to send image in mail body.
# 1  
Old 09-27-2015
Difficulty to send image in mail body.

I have jpg file in my server. I am facing difficulty while sending the image in body . appreciate your help to fix to below code.



Code:
 echo "--FILEBOUNDARY"
        echo "Content-Type: image/jpg"
        echo "Content-Disposition: inline; filename=\"tick.jpg\""
        echo "Content-Transfer-Encoding: base64"
        echo "Content-Id: <tickjpeg>"
 ############## Starts Reports##########
 
(
  echo To: jewel@xxx.com
  echo From: healthcheck@yyy.com
  echo "Content-Type: text/html; "
  echo Subject:System availability status of : `date "+%d-%b-%Y"`
  echo
  cat test.html
) | sendmail -t

---------- Post updated 09-27-15 at 12:05 AM ---------- Previous update was 09-26-15 at 05:27 PM ----------

Could you please try ..

Last edited by vbe; 09-26-2015 at 07:06 PM.. Reason: code tags please not ICODE
# 2  
Old 09-27-2015
You have shown us 5 lines of data that will be printed to the standard output of your script (not included in the body of your message and not as an attachment).

You have said that the body of your message does not correctly display the image you want it to include, but you have not shown us the contents of the file test.html (which contains the text that makes up the entire body of the message you're sending).

So, about all that we can say is that something in the HTML code in test.html is not correctly displaying the image you want to display. But, you already know that...
# 3  
Old 09-28-2015
HTML Code:
<html>
<body>
</v:shapetype><v:shape id="Picture_x0020_2" o:spid="_x0000_s1026" type="#_x0000_t75" alt="GREEN" style='position:absolute;margin-left:268.5pt;margin-top:5.95pt;width:104.25pt;height:27.75pt;z-index:251658240;visibility:visible;mso-wrap-style:square;mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;mso-position-horizontal-relative:text;mso-position-vertical:absolute;mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;mso-width-relative:page;mso-height-relative:page'><v:imagedata src=YOY1.png o:title=GREEN />
<span style='mso-ignore:vglayout;position:absolute;z-index:251658240;margin-left:358px;margin-top:8px;width:139px;height:37px'><img width=139 height=37 src=YOY2.png alt=GREEN v:shapes=Picture_x0020_2></span><![endif]><span style='font-size:10.0pt;font-family:Tahoma,sans-serif;color:blue'><o:p></o:p></span></p><div align=center><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='margin-left:30.2pt;border-collapse:collapse'><tr style='height:23.35pt'><td width=105 valign=top style='width:78.9pt;padding:0in 5.4pt 0in 5.4pt;height:23.35pt'><p class=MsoNormal align=right style='text-align:right'><b><span style='font-size:14.0pt;font-family:Tahoma,sans-serif;color:black'>YOY</span></b><b><span style='font-size:14.0pt;font-family:Tahoma,sans-serif'><o:p></o:p></span></b></p></td><td width=138 valign=top style='width:103.5pt;padding:0in 5.4pt 0in 5.4pt;height:23.35pt'></td></tr></table></div></td></tr><tr style='height:121.6pt'><td width=732 valign=top style='width:549.3pt;padding:0in 5.4pt 0in 5.4pt;height:121.6pt'><p class=MsoNormal><b>YOY - <span style='color:#33CC33'>GREEN</span><o:p></o:p></b></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>&middot;<span style='font:7.0pt Times New Roman'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><b>YOY Online accessibility</b>:&nbsp; YOY Production web interface is working fine and able to access the screens. <o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>&middot;<span style='font:7.0pt Times New Roman'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><b>End of day batch</b>: Successful and business date verified and system is available for next business date.<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol;color:black'><span style='mso-list:Ignore'>&middot;<span style='font:7.0pt Times New Roman'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><b>Reports Status</b>: Treasury Reports are generated and sent successfully.<span style='color:black'><o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='font-family:Symbol;color:black'><span style='mso-list:Ignore'>&middot;<span style='font:7.0pt Times New Roman'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><b>Month End Closing</b>: NA<span style='color:black'><o:p></o:p></span></p></td></tr><tr style='height:8.9pt'><td width=732 valign=top style='width:549.3pt;padding:0in 5.4pt 0in 5.4pt;height:8.9pt'><p><strong><span style='font-size:7.5pt;font-family:Arial,sans-serif;font-weight:normal'>Please contact</span></strong><strong><span style='font-size:7.5pt;font-family:Arial,sans-serif'> <i>**CPB CH Technology - Production Support</i> </span></strong><strong><span style='font-size:7.5pt;font-family:Arial,sans-serif;font-weight:normal'>for any questions/updates.</span></strong><b><span style='font-family:Arial,sans-serif'><o:p></o:p></span></b></p></td></tr></table><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='color:#17365D'><o:p>&nbsp;</o:p></span></b></p>
</body>
</html>
# 4  
Old 09-28-2015
The image YOY1.png is a file local to the sender and thus not accessible at the receiver. Add a valid URL.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. Shell Programming and Scripting

Embedding JPEG image to the body file

hi, I am trying to embed an image to the body of the email, but the image is not visible. echo "<html> <body> <style> body {background-color:blue} </style> <h1>hello</h1> <center> <img... (1 Reply)
Discussion started by: ATWC
1 Replies

3. Shell Programming and Scripting

send attachment and body in one mail using mailx

Hi, Our requirement is to send an attachment and content in a single mail. I am using the below command to send attachement. --------------------- (uuencode $exp_file $exp_file) |mailx -s "$email_subject" $EmailRecipients -------------------- I m not able to send any message in the... (4 Replies)
Discussion started by: ashwin3086
4 Replies

4. Shell Programming and Scripting

Send mail with rich text / HTML with image

Hi, Is it possible to send mail from my HP-Ux system with images, rich text? I would like to program in such a way that I have my company's logo(.jpg) image attached in the mail geeting triggered. I would like to send a rich text/HTML email instead of plain text mail to the recipients. Is it... (2 Replies)
Discussion started by: rythym05
2 Replies

5. Shell Programming and Scripting

how to send jpg as body

Hi, I ftp the .jpg file from windows to unix machine, now i need to send the jpg file as body to (not as attachment) outlook, can anyone send the sample code for this? (1 Reply)
Discussion started by: vasu.g
1 Replies

6. Shell Programming and Scripting

How to send a mail with attachement as well as message Body..?

Hi all, i am working with CSH, i want to know that how to send a mail in UNIX shell script (CSH) with attachment as well as message body. i know that how to send a mail with attachment and message body. but i want know both things in a single mail Suggession would be appreciate. ... (1 Reply)
Discussion started by: psiva_arul
1 Replies

7. AIX

Send mail attachments and have a mail body

Hi, How can I send mail attachments from shell script (AIX) and have a mail body as well ? Thanks in advance. (1 Reply)
Discussion started by: shibajighosh
1 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. UNIX for Dummies Questions & Answers

AIX send mail with HTML message body and a binary attachment

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 line switch to specify file name of a binary attachment 3. command line or input file to specify... (4 Replies)
Discussion started by: G-Man
4 Replies

10. UNIX for Dummies Questions & Answers

How to send body in a mail

Hi, How to send send body along with attachment in a mail given below is code to send mail with attachemnt.its working fine but i need to send some message as body of the mail. uuencode /prod/applc/ds_data/mac/working/nullctry.csv "nullctry.csv" | mailx -s "List Of Attendance"... (6 Replies)
Discussion started by: rajendragora
6 Replies
Login or Register to Ask a Question