BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem Sending Multipart E-mail Message

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet)
View previous topic :: View next topic  
Author Message
Saulo
Guest





PostPosted: Wed Oct 26, 2005 4:23 am    Post subject: Problem Sending Multipart E-mail Message Reply with quote



Hi,

I'm using BCB 6 with Indy 9 and I need help to send e-mails with a
text/plain and text/html parts in the same message.

I'm using this code but it's not working for me:

SMTP->Connect();
TIdMessage *IdMessage1 = new TIdMessage(NULL);
IdMessage1->IsEncoded = true;
IdMessage1->ContentType = "multipart/alternative";

TIdText *aTextPart = new TIdText(IdMessage1->MessageParts,NULL);
aTextPart->ContentType = "text/plain";
aTextPart->ContentTransfer = "quoted-printable";
aTextPart->Body->Add("This the plain text part!");

TIdText *aHtmlPart = new TIdText(IdMessage1->MessageParts,NULL);
aHtmlPart->ContentType = "text/html";
aHtmlPart->ContentTransfer = "quoted-printable";

mStream->Position = 0; // it contains the html code part
aHtmlPart->Body->LoadFromStream(mStream);

... regular stuff already tested for Recipients, Subject, FromName,
ReplyTo....

SMTP->Send(IdMessage1);
SMTP->Disconnect();

What could be wrong? Am I initializing the messageparts in the wrong
way?

Should I be using the IdMessage1->Body in some particular way? (here
I'm not initializing it)

Saulo I. Regis

Back to top
Saulo
Guest





PostPosted: Thu Oct 27, 2005 1:59 am    Post subject: Re: Problem Sending Multipart E-mail Message Reply with quote



With the code I presented in the previous message I'm receiving the
following message from my ISP SMTP Server (qmail)
****************************
MessageWall: SMTP/FATAL: Server sent a bare LF; please see
http://cr.yp.to/docs/smtplf.html
****************************

I changed the code line

aTextPart->Body->Add("This the plain text part!");

to

aTextPart->Body->Text = "This the plain text part!";

and the same fatal error comes from the SMTP Server.

What could be generating this error?

An advice, please...

Saulo I. Regis

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.