This is a multi-part message in MIME format.
--------------090109080008030802030001
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Przykładowy tekst.
--------------090109080008030802030001
Content-Type: image/jpeg;
name="aparat.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="aparat.jpg"
/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABQODxIPDRQSEBIXFRQYHjIhHhwcHj0sLiQySUBM
S0dARkVQWnNiUFVtVkVGZIhlbXd7gYKBTmCNl4x9lnN+gXz/2wBDARUXFx4aHjshITt8U0ZT
fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHz/wAAR
CAAyADIDASIAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAMEBQYCAQf/xAAvEAACAgEC
BAIIBwAAAAAAAAABAgADBBESBRMhMRQyIkFRYXFzobEkNFKBgpHR/8QAFQEBAQAAAAAAAAAA
AAAAAAAAAAH/xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAwDAQACEQMRAD8A7OJUs5trkDog
9jdTK9teWG1rZtunlMDTiYtuYcEL4rIdS/lXbr2klXEFsVHTMQhxqAwHUQNaJmtxHa20tWT8
D1nteIFuyKf5aQL8SGq1baksCn0lDf3ECGqzXUyQ2Ad5RR9j2J+ltJ6tfVl9zQIeMVYuWtNW
RTzbNx2AMRt9p1kHo461CqikcldqaoW2iSZN1GOLMrJJ2INui9ySewmfRxjh+ZYK+VZjknRb
N2o198ov05GNk2qt1FaWnsy+VpbempamZUC6CY9tTC8Vnzbxrp95pc4tiW7jqeo+kC/hfksf
5a/aJ9wh+Cx/lr9okFHKxcgZbtTVzK366hgNDISMlDo2Lb+w1m7EDms+l8zFag12I+4Om9CF
JHqJnPrwvKa8B6uSi92Y9AJ+izwK0B3BF19uktHM+PpWx7EYNa3RSx6KP9hMlGXlhwxPv7zp
GoqbzVI3xUTz4PF1B8PVqPXsEgYoK4tKkHUIo+kSeICIiAiIgIiICIiB/9k=
--------------090109080008030802030001--
Mam problem z wyświetlaniem obrazka w wysłanej wiadomości. A mianowicie wysyłam wiadomość typu text/html z załączonym plikiem graficznym. Chcę aby tem plik graficzny był od razu wyświetlony - niestety nie idzie po mej myśli.
Ktoś jest w stanie Mi napisać czego to wina? Czy kodu w C++ czy w HTML?
C++:
KOD cpp: UKRYJ
if(OpenDialog1->Execute())
{
TIdAttachment *IdAtt = new TIdAttachment(lMessage->MessageParts, OpenDialog1->FileName);
//wstawianie załącznika do wiadomości
Edit8->Text = ExtractFileName(OpenDialog1->FileName);
}
TIdMessage *lMessage;
TIdText *lTextPart;
IdSMTP1->Port = 587;
IdSMTP1->Host = Edit4->Text;
IdSMTP1->Password = Edit6->Text; // pobiera hasło nadawcy wiadomości
IdSMTP1->UserId = Edit7->Text; // pobiera nazwę nadawcy wiadomości - ID użytkownika
IdSMTP1->AuthenticationType = atLogin; // wymagana autoryzacja
lMessage = new TIdMessage(this);
//lMessage-> Encoding = meMIME;
lMessage->ContentType = "multipart/related";
lMessage->From->Address = Edit2->Text;
lMessage->Subject = "Give your subject";
lMessage->Recipients->EMailAddresses = Edit3->Text;
lMessage->Priority = mpHigh; //mpHighest;
lMessage->Body->Clear();
// Use this part for users who don't use e-mailclients with html support
lTextPart = new TIdText(lMessage->MessageParts, NULL);
lTextPart->Body->Text = "Your content in plaintext";
lTextPart->ContentType = "text/plain";
// Your message using html
lTextPart = new TIdText(lMessage->MessageParts, NULL);
lTextPart->Body->Text = Memo1->Lines->Text;
lTextPart->ContentType = "text/html";
TIdAttachment *IdAtt = new TIdAttachment(lMessage->MessageParts, OpenDialog1->FileName);
IdSMTP1->Connect();
IdSMTP1->Send(lMessage);
IdSMTP1->Disconnect();
{
TIdAttachment *IdAtt = new TIdAttachment(lMessage->MessageParts, OpenDialog1->FileName);
//wstawianie załącznika do wiadomości
Edit8->Text = ExtractFileName(OpenDialog1->FileName);
}
TIdMessage *lMessage;
TIdText *lTextPart;
IdSMTP1->Port = 587;
IdSMTP1->Host = Edit4->Text;
IdSMTP1->Password = Edit6->Text; // pobiera hasło nadawcy wiadomości
IdSMTP1->UserId = Edit7->Text; // pobiera nazwę nadawcy wiadomości - ID użytkownika
IdSMTP1->AuthenticationType = atLogin; // wymagana autoryzacja
lMessage = new TIdMessage(this);
//lMessage-> Encoding = meMIME;
lMessage->ContentType = "multipart/related";
lMessage->From->Address = Edit2->Text;
lMessage->Subject = "Give your subject";
lMessage->Recipients->EMailAddresses = Edit3->Text;
lMessage->Priority = mpHigh; //mpHighest;
lMessage->Body->Clear();
// Use this part for users who don't use e-mailclients with html support
lTextPart = new TIdText(lMessage->MessageParts, NULL);
lTextPart->Body->Text = "Your content in plaintext";
lTextPart->ContentType = "text/plain";
// Your message using html
lTextPart = new TIdText(lMessage->MessageParts, NULL);
lTextPart->Body->Text = Memo1->Lines->Text;
lTextPart->ContentType = "text/html";
TIdAttachment *IdAtt = new TIdAttachment(lMessage->MessageParts, OpenDialog1->FileName);
IdSMTP1->Connect();
IdSMTP1->Send(lMessage);
IdSMTP1->Disconnect();
HTML:
KOD html: UKRYJ
I nie wiem w czym leży problem