BuilderSpec
Programmer
Hi
I am trying to attach some files to an outlook e-mail message, can any body tell me what I am doing wrong ?
_NameSpaceDisp ns;
_MailItemDisp ml;
OutlookApplication1->Connect();
Attachments *A;
ns = OutlookApplication1->GetNamespace(WideString("MAPI"));
ml = OutlookApplication1->CreateItem(olMailItem);
ml.set_Subject(WideString(Subject->Text));
ml.set_To(WideString(To->Text));
ml.set_Body(WideString(Body->Text));
A = ml.Attachments;
Variant s = "test.txt";
Variant t = 1;
A->Add(s,t,t,s);
ml.Display();
If I don't try to add attachments code works fine , it;s just the attachments bit.
Hope this helps!
Regards
BuilderSpec
I am trying to attach some files to an outlook e-mail message, can any body tell me what I am doing wrong ?
_NameSpaceDisp ns;
_MailItemDisp ml;
OutlookApplication1->Connect();
Attachments *A;
ns = OutlookApplication1->GetNamespace(WideString("MAPI"));
ml = OutlookApplication1->CreateItem(olMailItem);
ml.set_Subject(WideString(Subject->Text));
ml.set_To(WideString(To->Text));
ml.set_Body(WideString(Body->Text));
A = ml.Attachments;
Variant s = "test.txt";
Variant t = 1;
A->Add(s,t,t,s);
ml.Display();
If I don't try to add attachments code works fine , it;s just the attachments bit.
Hope this helps!
Regards
BuilderSpec