General
cancel
Showing results for 
Search instead for 
Did you mean: 

sending html attachment using sendmail

SOLVED
Go to solution
Sunny Jaisinghani
Trusted Contributor

sending html attachment using sendmail

Hello All,

I got a script which i am using to send .html file embedded in an email using sendmail from my hpux box.

Now, everything is ok with the email except 2 images which are added to the html code.

When i get the email in my outlook, i don't see the images in the message body.

This is the script i am using

#! /usr/bin/ksh
MTA=/usr/lib/sendmail
VERSION=1.0

{
echo "From: sjaising@corp.com"
echo "To: sjaising@corp.com"
echo "Subject: Audit Mail"
echo "X-Mailer: htmlmail" $VERSION
echo "Mime-Version: 1.0"
echo "Content-Type: text/html; charset=US-ASCII"
echo
echo "`cat /home/rpotnuru/audit/audit_test.html`"
} | eval $MTA "sjaising@corp.com"

exit 0


and this is the htmml file



<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />










E&J Project - Audit Details






Base Dimension Tables Audit





















Redbrick Run Date Subject Area Table Name Acronym Redbrick CountOracle Run Date Oracle Count
Row1 Row1 Row1
14 REPLIES
Horia Chirculescu
Honored Contributor

Re: sending html attachment using sendmail

Hello,

Try to specify also the protocol when inserting images like this:



Best regards,
Horia.

Best regards from Romania,
Horia.
Sunny Jaisinghani
Trusted Contributor

Re: sending html attachment using sendmail

Hello Horia,

That did not help.
When i right click on the image box in outlook, i get 2 options. 1. copy, 2. Download.

Usually download option shows the image, but not in this case.



Sunny
Horia Chirculescu
Honored Contributor

Re: sending html attachment using sendmail

> but not in this case

What do you get in this case? Can you see the table formatted as it should be?

I am talking about:






Can you try to add a hyperlink to see if you can access it from outlook? (like this:




)

Also, try to see how the email looks like from another email client (web mail reader if availlable)

Horia.
Best regards from Romania,
Horia.
Steven Schweda
Honored Contributor

Re: sending html attachment using sendmail

> [...]
>
> [...]

Is that really what's in your HTML? Did you
expect that to work? ("393"?)
Steven E. Protter
Exalted Contributor

Re: sending html attachment using sendmail

Shalom,

Better you write this goodness to a file and use a script to attach the file.

http://www.hpux.ws/mailfile2

Change the details before you use my script.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sunny Jaisinghani
Trusted Contributor

Re: sending html attachment using sendmail

Horia,

I tried viewing the email in webmail. Doesn't help. ALso tried the hyperlink, but no luck.

Steven,

I got the html file from my client and i am just trying to send it in an email.
I am not a html expert. I don't understand what the html code is.

Sunny Jaisinghani
Trusted Contributor

Re: sending html attachment using sendmail

SEP

I tried your script.
Using that i got the .html file as an attachment.

When i open the attachment i can't still see the image on the html page.
Steven Schweda
Honored Contributor
Solution

Re: sending html attachment using sendmail

> I don't understand what the html code is.

Do you understand what a valid IP address
looks like? "8.1.393.2" is not a valid IP
address. (An octet can't be greater than
255.)

> I got the html file from my client [...]

Apparently, either you damaged it, or else it
was no good before you tried to turn it into
e-mail. Try putting this into a Web browser:

http://8.1.393.2/themes/base/clear.gif

If that doesn't work (and it can't possibly
work) outside of any e-mail message, then it
won't work inside an e-mail message, either.
Sunny Jaisinghani
Trusted Contributor

Re: sending html attachment using sendmail

Thanks Steven,

I was ignorant to see this mistake.
I have requested correct data from the client.

Sunny
S.N.S
Valued Contributor

Re: sending html attachment using sendmail

Sunny, SEP deserves more points then!!---SNS
"Genius is 1% inspiration, 99% Perspiration" - Edison
Steven Schweda
Honored Contributor

Re: sending html attachment using sendmail

> I don't understand what the html code is.

A Google (or other Web) search for keywords
like, say:
html primer
should find some basic instructional material
on HTML.
Horia Chirculescu
Honored Contributor

Re: sending html attachment using sendmail

Hello,

When you load this into a web browser

http://IP_ADDRESS/themes/base/clear.gif

Do you see the image?

It is important to specify the http:// in front of your link. Some of the web browsers will act like this even without this string but in order to prevent problems with others, you should always use the URL in the complete form.

Horia.
Best regards from Romania,
Horia.
Horia Chirculescu
Honored Contributor

Re: sending html attachment using sendmail

Also,

You should know that in the case of generating dynamic HTML files (as you are) you should use also Pragma: no-cache and Expires: 0 like this:



<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<meta http-equiv="EXPIRES" content="0" />

....

This is for preventing caching in your web browser or in any proxy used (if any).

Horia.
Best regards from Romania,
Horia.
Sunny Jaisinghani
Trusted Contributor

Re: sending html attachment using sendmail

Thanks Horia...

Once i have the correct IP address OR domain i will be able to test these things.

Cheers
Sunny