Page 1 of 1

Posted: 7 Feb 2007 11:27
by Tonton Luc
Hi,
Sending mail with content-type = "text/html" works fine too.
But when the html page contains a picture, the recipient does not see it (because picture's src = \"file:///D:/MyPicture.JPG\").
I tested setContentType("multipart/alternative") without success.
Any suggestion ?

Code: Select all

clauses     onTestCorpsHtml(_Source, _MenuTag):-         string5x::list_to_string(["<html>",             "<head>",             "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">",             "<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 4.0\">",             "<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">",             "<title>Nouvelle page 1</title>",             "</head>",             "<body onContextMenu=\"return false\">",             "<form method=\"POST\" action=\"\" name=\"frm\">",             "<p><img border=\"0\" src=\"file:///D:/...xxx.../MyPicture.JPG\" width=\"668\" height=\"390\"></p>",             "</form>",             "</body>",             "</html>"],"",Message),                 M = sendMail_smtp::new("smtp.wanadoo.fr"),         M:setContentType("text/html"),         M:send(["lucg@jdklog.com"],[],"lucg@jdklog.com","Test 2",Message),         stdIO::writef("ok\n"),         !.

Posted: 7 Feb 2007 14:10
by Thomas Linder Puls
There are two ways to deal with images in HTML.
  • Either the HTML can link to an image on the Internet.
  • Or the Image can be attached to the mail and the link should then go to the attachment.
The first method is often used when sending out news letters etc, because the news letter (and hence the images) is often on the Internet anyway. It is a solid method that almost always works.

The second method makes the mail self contained, on the other hand some mail clients does not handle it properly.

The second method also has the problem that I don't know how it is done ;-). But I can tell you that it has to do with MIME (Multipurpose Internet Mail Extensions) and Multipart Messages.

If you learn it, please teach us how to do it.

Posted: 7 Feb 2007 14:22
by Tonton Luc
If you learn it, please teach us how to do it.
Ok, no problm.
For the moment, I'll use the first method. Thanks.

Posted: 25 Jan 2014 11:53
by drspro2
I think this link might be usefull,



http://htmlemailboilerplate.com/

Posted: 4 Feb 2014 9:00
by Jan de Lint
Indeed, thanks!
]an