Article

From:
To:
Remy Lebeau \(Indy Team\)
Subject:
Re: HTML email - views fine in Outlook, wrong in GMail and other webmail viewers
Newsgroup:
atozedsoftware.indy.protocol.smtp

Re: HTML email - views fine in Outlook, wrong in GMail and other webmail viewers

* I have made some changes in code in keeping with your last comments, but
the only improvement is that we now do not have the plain text element
displayed.

* This is nothing to do with Google or Yahoo settings. I can send HTML emails from Outlook quite happily and read them in Google and Yahoo correctly. I think I said in an earlier post that I had compared the text of my Indy message in Google with that of another (ie successful one) and pointed out some differences to you. * Here is the full email message in text form as requested (however I have removed the image data as it was exceeding the size permitted in posts here - instead I have put [image data]): Delivered-To: ✉gmail.com Received: by 10.82.124.8 with SMTP id w8cs18519buc;         Thu, 18 Oct 2007 06:48:24 -0700 (PDT) Received: by 10.141.99.4 with SMTP id b4mr285855rvm.1192715302239;         Thu, 18 Oct 2007 06:48:22 -0700 (PDT) Return-Path: <✉artlooknetwork.com> Received: from mx252h.mysite4now.com (mx252h.mysite4now.com [209.132.200.252])         by mx.google.com with ESMTP id c3si1459011rvf.2007.10.18.06.48.19;         Thu, 18 Oct 2007 06:48:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.132.200.252 is neither permitted nor denied by best guess record for domain of ✉artlooknetwork.com) client-ip=209.132.200.252; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.132.200.252 is neither permitted nor denied by best guess record for domain of ✉artlooknetwork.com) smtp.mail=✉artlooknetwork.com Message-Id: <✉mx.google.com> Received: from host81-159-210-27.range81-159.btcentralplus.com [81.159.210.27] by mx252h.mysite4now.com with SMTP;    Thu, 18 Oct 2007 06:47:55 -0700 From: "Morag MacInnes" <✉artlooknetwork.com> Subject: Artlook HTML mail testing To: ✉artlooknetwork.com Content-Type: multipart/alternative; charset="iso-8859-1"; boundary="Cm8xJYly3LeP8V=_cWHTbrq6r6sVpMdnST" MIME-Version: 1.0 Reply-To: ✉artlooknetwork.com Date: Thu, 18 Oct 2007 14:47:37 +0100 X-Mailer: Artlook
This is a multi-part message in MIME format
--Cm8xJYly3LeP8V=_cWHTbrq6r6sVpMdnST Content-Type: text/plain Content-Transfer-Encoding: quoted-printable
Your reader does not support HTML
--Cm8xJYly3LeP8V=_cWHTbrq6r6sVpMdnST Content-Type: multipart/related; type="text/html";         boundary="qh2=_oFwFRh25V1YSI1BOy76unx5xZXjK5"
--qh2=_oFwFRh25V1YSI1BOy76unx5xZXjK5 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Artlook report</TITLE> <META charset=3DISO-8859-1 http-equiv=3DContent-Style-Type content=3Dt= ext/css> <META content=3D"" name=3DKeywords> <META content=3DArtlook name=3DAuthor> <META content=3DArtlook name=3DCreator> <META content=3D"PsRBExportDevices V1.11 for ReportBuilder (www.pragna= an.com)"=20 name=3DProducer> <STYLE> <!-- BODY {background: #FFFFFF no-repeat center fixed} DIV {position:absolute; font:10pt Arial; color: #000000}.S0 {font: bol= d 10pt Arial; color: #000000}.S1 {font: 9pt Arial; color: #FFFFFF}.S2 = {font: 9pt Arial; color: #000000}.S3 {font: 6pt Arial; color: #000000}= =2ES4 {font: 8pt Arial; color: #000000}.S5 {font: 7pt Arial; color: #0= 00000}SPAN {position: absolute; visibility: hidden} --> </STYLE>
<META content=3D"MSHTML 6.00.6000.16544" name=3DGENERATOR></HEAD> <BODY bgColor=3D#ffffff> <DIV=20 style=3D"FONT-WEIGHT: normal; FONT-SIZE: 0pt; LEFT: 59px; WIDTH: 50px;=  LINE-HEIGHT: normal; FONT-STYLE: normal; TOP: 56px; HEIGHT: 90px; BAC= KGROUND-COLOR: #ffffff; FONT-VARIANT: normal"></DIV> <DIV class=3DS0 style=3D"LEFT: 53px; WIDTH: 686px; LINE-HEIGHT: 18px; = TOP: 155px"=20 noWrap>MacInnes MORAG 1951-<BR></DIV> <DIV class=3DS1 style=3D"LEFT: 53px; WIDTH: 188px; LINE-HEIGHT: 14px; = TOP: 174px"=20 noWrap><BR></DIV> <DIV class=3DS0 style=3D"LEFT: 53px; WIDTH: 683px; LINE-HEIGHT: 17px; = TOP: 188px"=20 noWrap>Mermaid Sculpture<BR></DIV> <DIV class=3DS2 style=3D"LEFT: 56px; WIDTH: 679px; LINE-HEIGHT: 15px; = TOP: 215px"=20 noWrap>Test test test test test<BR></DIV> <DIV class=3DS2 style=3D"LEFT: 56px; WIDTH: 677px; LINE-HEIGHT: 15px; = TOP: 235px"=20 noWrap>Smoke fired clay<BR></DIV> <DIV class=3DS2 style=3D"LEFT: 55px; WIDTH: 677px; LINE-HEIGHT: 16px; = TOP: 254px"=20 noWrap>35 x 12 x 12 cms (88.90 x 30.48 cms)<BR></DIV> <DIV class=3DS2 style=3D"LEFT: 55px; WIDTH: 103px; LINE-HEIGHT: 14px; = TOP: 275px"=20 noWrap>=A380</DIV> <DIV class=3DS3 style=3D"LEFT: 55px; WIDTH: 155px; LINE-HEIGHT: 10px; = TOP: 288px"=20 noWrap>plus tax</DIV> <DIV class=3DS4 style=3D"LEFT: 56px; WIDTH: 188px; LINE-HEIGHT: 13px; = TOP: 297px"=20 noWrap><BR><BR></DIV> <DIV=20 style=3D"FONT-WEIGHT: normal; FONT-SIZE: 0pt; LEFT: 48px; WIDTH: 475px= ; LINE-HEIGHT: normal; FONT-STYLE: normal; TOP: 321px; HEIGHT: 346px; = BACKGROUND-COLOR: #ffffff; FONT-VARIANT: normal"></DIV> <DIV class=3DS3 style=3D"LEFT: 68px; WIDTH: 103px; LINE-HEIGHT: 15px; = TOP: 675px"=20 noWrap></DIV> <DIV style=3D"LEFT: 67px; WIDTH: 572px; TOP: 675px; HEIGHT: 0px"><IMG = height=3D0=20 alt=3D"" src=3D"cid:10001" width=3D572></DIV> <DIV class=3DS3 style=3D"LEFT: 65px; WIDTH: 188px; LINE-HEIGHT: 10px; = TOP: 675px"=20 noWrap><BR></DIV> <DIV class=3DS3 style=3D"LEFT: 68px; WIDTH: 103px; LINE-HEIGHT: 15px; = TOP: 684px"=20 noWrap></DIV> <DIV style=3D"LEFT: 67px; WIDTH: 573px; TOP: 684px; HEIGHT: 0px"><IMG = height=3D0=20 alt=3D"" src=3D"cid:10002" width=3D573></DIV> <DIV class=3DS3 style=3D"LEFT: 64px; WIDTH: 188px; LINE-HEIGHT: 10px; = TOP: 684px"=20 noWrap><BR></DIV> <DIV class=3DS3 style=3D"LEFT: 70px; WIDTH: 128px; LINE-HEIGHT: 10px; = TOP: 693px"=20 noWrap></DIV> <DIV style=3D"LEFT: 67px; WIDTH: 572px; TOP: 693px; HEIGHT: 0px"><IMG = height=3D0=20 alt=3D"" src=3D"cid:10003" width=3D572></DIV> <DIV class=3DS3 style=3D"LEFT: 65px; WIDTH: 188px; LINE-HEIGHT: 10px; = TOP: 693px"=20 noWrap><BR></DIV> <DIV style=3D"LEFT: 67px; WIDTH: 569px; TOP: 702px; HEIGHT: 15px"><IMG=  height=3D15=20 alt=3D"" src=3D"cid:10004" width=3D569></DIV> <DIV style=3D"LEFT: 53px; WIDTH: 139px; TOP: 339px; HEIGHT: 328px"><IM= G height=3D328=20 alt=3D"" src=3D"cid:10005" width=3D139></DIV> <DIV class=3DS5 style=3D"LEFT: 121px; WIDTH: 104px; LINE-HEIGHT: 11px;=  TOP: 1064px"=20 noWrap>October 18, 2007 14:47</DIV> <DIV class=3DS5=20 style=3D"LEFT: 66px; WIDTH: 52px; CLIP: rect(0px 52px 11px 0px); LINE-= HEIGHT: 11px; TOP: 1064px; TEXT-ALIGN: right"=20 noWrap>Page 1 of 1</DIV>Here is the information you requested:</BODY><= /HTML>
--qh2=_oFwFRh25V1YSI1BOy76unx5xZXjK5 Content-Type: image/jpeg;         name="ALDOC149_I0001.jpg" Content-Transfer-Encoding: base64 Content-Disposition: inline;         filename="ALDOC149_I0001.jpg" Content-ID: 10001
[image data]
--qh2=_oFwFRh25V1YSI1BOy76unx5xZXjK5 Content-Type: image/jpeg;         name="ALDOC149_I0002.jpg" Content-Transfer-Encoding: base64 Content-Disposition: inline;         filename="ALDOC149_I0002.jpg" Content-ID: 10002
[image data]
--qh2=_oFwFRh25V1YSI1BOy76unx5xZXjK5 Content-Type: image/jpeg;         name="ALDOC149_I0003.jpg" Content-Transfer-Encoding: base64 Content-Disposition: inline;         filename="ALDOC149_I0003.jpg" Content-ID: 10003
[image data]
--qh2=_oFwFRh25V1YSI1BOy76unx5xZXjK5 Content-Type: image/jpeg;         name="ALDOC149_I0004.jpg" Content-Transfer-Encoding: base64 Content-Disposition: inline;         filename="ALDOC149_I0004.jpg" Content-ID: 10004
[image data]
--qh2=_oFwFRh25V1YSI1BOy76unx5xZXjK5 Content-Type: image/jpeg;         name="ALDOC149_I0005.jpg" Content-Transfer-Encoding: base64 Content-Disposition: inline;         filename="ALDOC149_I0005.jpg" Content-ID: 10005
[image data]
--qh2=_oFwFRh25V1YSI1BOy76unx5xZXjK5--
--Cm8xJYly3LeP8V=_cWHTbrq6r6sVpMdnST--


* Here is my revised code:
       MyMessage.IsEncoded:=True ;        MyMessage.Subject := edtMsgSubject.Text;        MyMessage.From.Text := smtpUser;        MyMessage.From.Name := mainform.RegisteredUser;        MyMessage.From.Address := smtpFrom;        MyMessage.Recipients.Clear;        MyMessage.Recipients.add.text := smtpFrom;        MyMessage.ReplyTo.add.text := smtpFrom;        MyMessage.BCCList.Clear;        for x := 1 to email1.Bcc.Count do           MyMessage.BCCList.Add.Text := email1.Bcc[x-1];
       if listbox1.items.count = 0 then           MyMessage.ContentType := 'multipart/alternative'        else           MyMessage.ContentType := 'multipart/mixed';
       MyMessage.ClearBody();
//make a plain text alternative part        with TIdText.Create(MyMessage.MessageParts, nil) do        begin            Body.Text := 'Your reader does not support HTML';            ContentType := 'text/plain';        end;
//make the html part        with TIdText.Create(myMessage.MessageParts, nil) do        begin            ContentType := 'multipart/related; type="text/html"';        end;
//load the html file with content for sending        with TIdText.Create(myMessage.MessageParts, nil) do begin          Body.LoadFromFile(DocDirectory + '\htmlmail.htm');          ContentType := 'text/html';          ParentPart := 1;        end;
//load the inline images        cid := 10000;
       for x := 1 to eImages.Count do begin           inc(cid);           with TIdAttachmentFile.Create(myMessage.MessageParts, DocDirectory + '\' + eImages[x-1]) do begin             ContentID := inttostr(cid);             ContentType := 'image/jpeg';             ContentDisposition := 'inline';             ParentPart := 1;           end;        end;

//load any normal attachments        for x := 1 to listbox1.items.count do begin           inc(cid);           with TIdAttachmentFile.Create(myMessage.MessageParts, listBox1.items[x-1]) do begin             ContentID := inttostr(cid);             ContentType := GetMimeTypeFromFile(listbox1.items[x-1]);           end;        end;

Thanks.
Jonathan
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Fri, 29 Mar 2024 12:13:12 UTC
Copyright © 2009-2024
HREF Tools Corp.