|Subject:||HTML with attachments|
|Posted by:||Paulo Tesche (pstesc…@hotmail.com)|
|Date:||Sun, 17 Aug 2003|
IÂ´m almost done with my BCB6 e-mail sender application but I have one last problem.
IÂ´m sure itÂ´s something I missed in the examples of Indy(they are mainly in Delphi).
The Indy version IÂ´m usig is 9.00.14
I can successfully send messages with plain text or HTML formatted too. But when it cames to include attachments it works only with plain text messages.
If a HTML formatted message with attachment(s) is sent, the message is sent OK but arrives with the HTML code shown as plain text.
IÂ´m using Outlook 2000 and Outlook Express as mail readers.
What is wrong with my code?
The piece of code that sends the message is listed above...
void __fastcall TFrmMain::btSendClick(TObject *Sender)
// Msg is a TIdMessage component
Msg->From->Text = ebFromEmail->Text;
Msg->From->Name = ebFromName->Text;
Msg->Recipients->EMailAddresses = ebTo->text;
Msg->Subject = ebSubject->Text;
Msg->ReplyTo->EMailAddresses = ebReturnTo->Text;
Msg->ContentType = "text/html";
// Adds the attachments
for (i=0; i<grdAttach->RowCount-1; i++)
new TIdAttachment(Msg->MessageParts, grdAttach->Cells[i]);