Discussion:
Send HTML files as body thru Blat
jayadev65
2008-06-14 10:31:23 UTC
Permalink
Hi,

Need to send HTML file thru Blat to many clients, the HTML has been
created using MS-word 2000 (using save as html). The email is
properly sent, but the images within the html are not displayed to
the receipent.

Following is the code used to send the email:

function send_mail(cEmailAddress)
sendemail("blat ",;
" importedintro.html"+;
" -to "+cEmailAddress+;
" -server smtp.abc.com"+;
" -u ***@abc.com -pw 123445"+;
" -SuperDebugT"+;
" -log blat.log -overwritelog"+;
" -mime "+;
" -html"+;
" -subject Availability.")
return NIL

function sendemail(sProgram,sCommandLine)
run (sProgram+" "+sCommandLine)
reportfile("blat.log")
msg("Mail Sent");wait
return NIL

I have even tried -embed image1.jpg within the above code though the
specific location of the image files are mentioned within the HTML
itself. still no sucess. Where am I wrong.

Any help is appreciated.

Warm regards,

Jayadev.
Tim Musson
2008-06-14 12:10:54 UTC
Permalink
Hey jayadev65,

On Saturday, June 14, 2008 at 6:31:23 AM you wrote

j> Hi,

j> Need to send HTML file thru Blat to many clients, the HTML has been
j> created using MS-word 2000 (using save as html). The email is
j> properly sent, but the images within the html are not displayed to
j> the receipent.

j> Following is the code used to send the email:

j> function send_mail(cEmailAddress)
j> sendemail("blat ",;
j> " importedintro.html"+;
j> " -to "+cEmailAddress+;
j> " -server smtp.abc.com"+;
j> " -u ***@abc.com -pw 123445"+;
j> " -SuperDebugT"+;
j> " -log blat.log -overwritelog"+;
j> " -mime "+;
j> " -html"+;
j> " -subject Availability.")
j> return NIL

j> function sendemail(sProgram,sCommandLine)
j> run (sProgram+" "+sCommandLine)
j> reportfile("blat.log")
j> msg("Mail Sent");wait
j> return NIL

j> I have even tried -embed image1.jpg within the above code though the
j> specific location of the image files are mentioned within the HTML
j> itself. still no sucess. Where am I wrong.

It is not so much you being wrong, as not having a bit of info... When
you send html and want to embed images in the message to be displayed
by the html code, you have to add CID: to your image filename.

For example, if you have <img src="blat.png"> in your html code, you
need to change it so it looks like this.

<img src="CID:blat.png">
^^^^

Then include blat.png on the blat command line with the
-embed blat.png
option.

Finally, if you want clients that don't read html messages to get
anything useful, you may want to consider creating a plain text
version and including it with the
-alttextf PlainTextVersion.txt
option.
--
Tim Musson
Flying with The Bat! eMail v3.99.29
I'm not a complete idiot -- Some parts are just missing.
Blat Manager, current version is 2.6.2, see www.blat.net
namtog
2008-06-14 14:28:01 UTC
Permalink
Greetings,

Below is a example that can be run from the prompt.
Each option on a separate line for easy reading.

blat
body.html
-to ***@someplace.com
-f "***@domain"
-subject "test"
-html
-alttextf body.txt
-embed logo.gif


The HTML can be this simple;

<html><body><img src="cid:logo.gif">
<p>Dear Sir/Madam,</p>
<p>Please read this note and sign your life away.</p>
<p>Devilishly yours,</p>
<p>Bob</p>
</body></html>

Namtog
Jayadev Urath
2008-06-15 11:28:42 UTC
Permalink
Dear Tim,
 
Many thanks for your prompt reply.
 
I had already modified the code as under in the HTML file as under.
 
<v:imagedata src="cid:./importedintro_files/image001.jpg" o:title="image001"/>
 
I had also included -embed image001.jpg statment in the command line. 
 
When I send the mail, the image001.jpg comes as an attachment to the receipient and in the place wherein in image should be within the html there is a red X Mark saying that there is a picture, but the picture does not get "embeded".
 
Pls let me know as to what further needs to done.
 
Warm regards,
 
Jayadev
 
 


Explore your hobbies and interests. Go to http://in.promos.yahoo.com/groups/

[Non-text portions of this message have been removed]
Tim Musson
2008-06-15 12:59:52 UTC
Permalink
Hey Jayadev,

On Sunday, June 15, 2008 at 7:28:42 AM you wrote

JU> I had already modified the code as under in the HTML file as
JU> under.

JU> <v:imagedata src="cid:./importedintro_files/image001.jpg" o:title="image001"/>

I don't think that is HTML...

I put this in a t.html file
<img src="blat.png" alt="">
<hr>
<v:imagedata src="blat.png" o:title="image001"/>

and tried to open it with both FireFox and Internet Explorer. I get
one copy of the image and a line. Nothing for the <v:imagedata... tag.

Try changing your tag to look like the <img... tag and see if it
works.
--
Tim Musson
Flying with The Bat! eMail v3.99.29
A teen asked if infertility was hereditary...
Blat Manager, current version is 2.6.2, see www.blat.net
namtog
2008-06-15 17:26:34 UTC
Permalink
Greetings,

TM wrote;
"I put this in a t.html file
<img src="blat.png" alt="">
<hr>

<snip>

I get one copy of the image and a line."

<hr> equals hard rule.

This is a line.

Persnickety yours,
Namtog
Tim Musson
2008-06-16 00:15:48 UTC
Permalink
Hey namtog,

On Sunday, June 15, 2008 at 1:26:34 PM you wrote

n> Greetings,

n> TM wrote;
n> "I put this in a t.html file
n> <img src="blat.png" alt="">
n> <hr>

n> <snip>

n> I get one copy of the image and a line."

n> <hr> equals hard rule.

n> This is a line.

n> Persnickety yours,

LOL, yep, that is what I expected. I was not sure what the other image
tag was going to do - I expected I MAY get an image, line, image. But
I didn't. I just got image, line, nothing.
--
Tim Musson
Flying with The Bat! eMail v3.99.29
Beauty is in the eye of the beer holder.
Blat Manager, current version is 2.6.2, see www.blat.net
Chip
2008-06-15 20:40:48 UTC
Permalink
Post by Jayadev Urath
<v:imagedata src="cid:./importedintro_files/image001.jpg"
o:title="image001"/>
Put the XML file itself, and all your pictures into a single directory, not
into separate directories like M$ Word does. When you have that, then
remove the directory paths from all your links embedded within your XML,
because your recipients will not have your same directory structure.

The above line should read:

<v:imagedata src="cid:image001.jpg" o:title="image001">
--
Chip


------------------------------------
--
Homepage:
http://www.blat.net
namtog
2008-06-15 20:57:58 UTC
Permalink
Greetings,

To clean up MS Word files try here;

http://www.codinghorror.com/blog/archives/000485.html

For more applications read this;

http://tech.groups.yahoo.com/group/blat/message/10592

Namtog
Jayadev Urath
2008-06-16 07:13:42 UTC
Permalink
Dear Tim,
 
The whole problem was that I had used the HTML file created by MS Word. 
 
I understood your drift, created a simple HTML file and used -embed in the command line, everything works fine now.
 
Thank you for your valuable imputs.
 
Many thanks to Mr. Namtog also.
 
Incidentally, since I am using xHarbour to run thru a .dbf file to send emails, how can I capture the return code of Blat as in the following code I am using RUN statement to fire blat.
 
 
function sendemail(sProgram,sCommandLine)
  run  (sProgram+" "+sCommandLine)
return NIL
 
sProgram = Blat
sCommandLine = commandline
 
(see my earlier email for the code)
 
Warm regards,
 
Jayadev.
 


Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/

[Non-text portions of this message have been removed]
Tim Musson
2008-06-16 11:42:40 UTC
Permalink
Hey Jayadev,

On Monday, June 16, 2008 at 3:13:42 AM you wrote

JU> Incidentally, since I am using xHarbour to run thru a .dbf file
JU> to send emails, how can I capture the return code of Blat as in
JU> the following code I am using RUN statement to fire blat.

JU> function sendemail(sProgram,sCommandLine)
JU> run (sProgram+" "+sCommandLine)
JU> return NIL

JU> sProgram = Blat
JU> sCommandLine = commandline

How would you normally get a return code for an external application
xHarbour?
--
Tim Musson
Flying with The Bat! eMail v3.99.29
Keyboard Not Found - Press [F1] to Continue
Blat Manager, current version is 2.6.2, see www.blat.net
Liz Ackerman
2008-06-16 18:33:17 UTC
Permalink
If you have the option, post those images on a webserver. I don't have any
issues when they are formatted as <img
src="Loading Image... border="0"> within the HTML
file.

Word does horrible things to html when the image is located locally. If you
want to do the embed thing as suggested by others, edit the html file using
Notepad or a simple text editor to get the CID. I have found the simpliest
of all ways is what I use above.

Liz




Hi,

Need to send HTML file thru Blat to many clients, the HTML has been
created using MS-word 2000 (using save as html). The email is
properly sent, but the images within the html are not displayed to
the receipent.

Following is the code used to send the email:

function send_mail(cEmailAddress)
sendemail("blat ",;
" importedintro.html"+;
" -to "+cEmailAddress+;
" -server smtp.abc.com"+;
" -u ***@abc.com <mailto:xyz%40abc.com> -pw 123445"+;
" -SuperDebugT"+;
" -log blat.log -overwritelog"+;
" -mime "+;
" -html"+;
" -subject Availability.")
return NIL

function sendemail(sProgram,sCommandLine)
run (sProgram+" "+sCommandLine)
reportfile("blat.log")
msg("Mail Sent");wait
return NIL

I have even tried -embed image1.jpg within the above code though the
specific location of the image files are mentioned within the HTML
itself. still no sucess. Where am I wrong.

Any help is appreciated.

Warm regards,

Jayadev.

.

<http://geo.yahoo.com/serv?s=97359714/grpId=311137/grpspId=1705007389/msgId=
10596/stime=1213444999/nc1=4025291/nc2=4507179/nc3=4836041>



[Non-text portions of this message have been removed]

Loading...