🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#2931
From: Remy Lebeau (TeamB)
Date: Thu, 22 Dec 2005 19:00
37 lines
2152 bytes
<Francesco> wrote in message news:43aac389@newsgroups.borland.com...

>   I want to send a html mail using SMTP of Indy 9, when
> i receive the mail i see the attaches but the mail is empty

Try this instead:

    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(MainMessage->MessageParts, NULL);
    HTML->Body->LoadFromFile("c:\\mail.htm");
    HTML->ContentType = "text/html";

    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";

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


Gambit
Technical Details
Message-ID: <43aaf78e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <43aac389@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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <43aac389@newsgroups.borland.com>
Subject: Re: Send Html Email with Indy component doesn't work
Date: Thu, 22 Dec 2005 11:00:57 -0800
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <43aaf78e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1135277966 68.69.17.41 (22 Dec 2005 10:59:26 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail