S
Slava ilyin
Can not find how to force MailMessage to send attached file in base64
format. Even if you added
pMsg.Headers.Add("Content-Transfer-Encoding","base64") in your code -
it is not worked if you have HTMLBody in message (quated-printable is
used for attach instead of base64).
That is the reason of very serious trouble!
For example, I have found some "." chars lost in the received file
,etc...
The only one possible fix I've found is to
use CDOEX.dll interop instead:
Interop::CDO::MessageClass* o = new Interop::CDO::MessageClass();
o->To = "..";
o->From = "..";
o->Subject = "subj";
o->BodyPart->ContentTransferEncoding = "base64";
o->BodyPart->Fields->Update();
o->HTMLBody = "Test";
Interop::CDO::IBodyPart* obp = o->AddAttachment
("c:\\Test.xls","","");
obp->ContentTransferEncoding = "base64";
obp->Fields->Update();
o->Send();
OR
Interop::CDONTS::NewMailClass * MailMessage = new
Interop::CDONTS::NewMailClass;
MailMessage->From = "..";
....
MailMessage->BodyFormat = 0;
MailMessage->MailFormat = 0;
MailMessage->AttachFile("...", "...", 1 ) ;
MailMessage->Send();
Any suggestions on this?
Thanks,
Slava
format. Even if you added
pMsg.Headers.Add("Content-Transfer-Encoding","base64") in your code -
it is not worked if you have HTMLBody in message (quated-printable is
used for attach instead of base64).
That is the reason of very serious trouble!
For example, I have found some "." chars lost in the received file
,etc...
The only one possible fix I've found is to
use CDOEX.dll interop instead:
Interop::CDO::MessageClass* o = new Interop::CDO::MessageClass();
o->To = "..";
o->From = "..";
o->Subject = "subj";
o->BodyPart->ContentTransferEncoding = "base64";
o->BodyPart->Fields->Update();
o->HTMLBody = "Test";
Interop::CDO::IBodyPart* obp = o->AddAttachment
("c:\\Test.xls","","");
obp->ContentTransferEncoding = "base64";
obp->Fields->Update();
o->Send();
OR
Interop::CDONTS::NewMailClass * MailMessage = new
Interop::CDONTS::NewMailClass;
MailMessage->From = "..";
....
MailMessage->BodyFormat = 0;
MailMessage->MailFormat = 0;
MailMessage->AttachFile("...", "...", 1 ) ;
MailMessage->Send();
Any suggestions on this?
Thanks,
Slava