🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #2945

Re: Send Html Email with Indy component doesn't work

#2945
From: Francesco
Date: Tue, 27 Dec 2005 07:38
123 lines
4254 bytes
  Hi Remy,
  I'm using BCB 5 Pro, here follows my code and generated mail msg:



    MailMessage->From->Address = "mail@mail.com";
    MailMessage->From->Name = "sender";
    MailMessage->Recipients->EMailAddresses = "info@mail.com";

    MailMessage->ContentType = "multipart/related; type=\"text/html\"";

    TIdText *HTML = new TIdText(MailMessage->MessageParts, NULL);
    HTML->Body->LoadFromFile("c:\\mail.htm");
    HTML->ContentType = "text/html";


    TIdAttachment *IImagePart3 = new
    TIdAttachment(MailMessage->MessageParts, "c:\\topaug.gif");
    IImagePart3->ContentID = "topaug.gif";
    IImagePart3->ContentType = "image/gif";
    IImagePart3->FileName = "topaug.gif";

    TIdAttachment *IImagePart = new
    TIdAttachment(MailMessage->MessageParts, "c:\\content.gif");
    IImagePart->ContentID = "content.gif";
    IImagePart->ContentType = "image/gif";
    IImagePart->FileName = "content.gif";

    TIdAttachment *IImagePart2 = new
    TIdAttachment(MailMessage->MessageParts, "c:\\down.gif");
    IImagePart2->ContentID = "down.gif";
    IImagePart2->ContentType = "image/gif";
    IImagePart2->FileName = "down.gif";


    SMTP->Connect(1000);
    SMTP->Send(MailMessage);
    SMTP->Disconnect();

here mail.htm that stays on c:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>Loveshopping auguri!</title>
</head>

<body>


	<table width="" align="center" border="0" cellSpacing=0 cellPadding=0>
<tr>
	<td><img src="cid:topaug.gif" width="662" height="155" alt=""
border="0"></td>
</tr>
<tr>
	<td><img src="cid:content.gif" width="662" height="341" alt=""
border="0"></td>
</tr>
<tr>
	<td valign="top"><img src="cid:down.gif" width="662" height="133"
alt="" border="0"></td>
</tr>
</table>


</body>
</html>


The mail arrives, I see the 3 img files attached but the body of the
mail is empty and if I show in html, this is what i have:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=iso-8859-1"></HEAD>
<BODY></BODY></HTML>



If instead of using MailMessage->ContentType = "multipart/related;
type=\"text/html\""; I use MailMessage->ContentType = "text/html";
at least I see that is not able to link to images but the htm code is
the same I've sent.


   Any idea?








Remy Lebeau (TeamB) wrote:

> 
> <Francesco> wrote in message news:43ac0e30@newsgroups.borland.com...
> 
> > There was an old include file IdMessage.hpp
> 
> Are you using BCB6, by chance?  BCB6 ships with Indy 8 pre-installed.
> Indy 8 is not compatible with Indy 9 and must be removed from the
> machine before Indy 9 will work properly.  There are removal
> instructions in Indy's Knowledge Base.
> 
> > now update but id doesn't work anyway, I receive the mail
> > with attachments but mail body is empty and if I try to see in
> > html i don't see the code i put before.
> 
> Please show your actual code and the actual message data that is being
> generated, headers and everything.
> 
> 
> Gambit



-- 
Technical Details
Message-ID: <43b0fd95@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!207.225.159.16.MISMATCH!mpls-transit-01.news.qwest.net!38.119.100.82.MISMATCH!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43aac389@newsgroups.borland.com> <43aaf78e$1@newsgroups.borland.com> <43abaac3@newsgroups.borland.com> <43abdc19$3@newsgroups.borland.com> <43ac0e30@newsgroups.borland.com> <43ac59b7$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,9d6c4b1081b0b15
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Francesco" <>
Subject: Re: Send Html Email with Indy component doesn't work
Newsgroups: borland.public.cppbuilder.internet.socket
References: <43aac389@newsgroups.borland.com> <43aaf78e$1@newsgroups.borland.com> <43abaac3@newsgroups.borland.com> <43abdc19$3@newsgroups.borland.com> <43ac0e30@newsgroups.borland.com> <43ac59b7$1@newsgroups.borland.com>
User-Agent: XanaNews/1.17.6.6
NNTP-Posting-Host: 217.172.212.72
Message-ID: <43b0fd95@newsgroups.borland.com>
Date: 27 Dec 2005 00:38:45 -0700
X-Trace: newsgroups.borland.com 1135672725 217.172.212.72 (27 Dec 2005 00:38:45 -0700)
Lines: 124
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!207.225.159.16.MISMATCH!mpls-transit-01.news.qwest.net!38.119.100.82.MISMATCH!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail