jeudi 3 novembre 2022

Send email with RAD Studio cpp11

I am trying to port an old Borland C++ application to the new RAD studio 11 format an I cannot get it to send emails using Outlook_2K_SRVR.h. Would anyone have sample code to send emails with RAD studio 11? in C++?

This is the part of the code that does not work.


`
`#define  Outlook_2k_olMailItem         OlItemType::olMailItem`

`//---------------------------------------------------------------------------
#pragma package(smart_init)

//----------------------------------
// emailing ...
//----------------------------------
#pragma link "Outlook_2K_SRVR"  

void __fastcall TLicMainForm::Button1Click(TObject *Sender)
{
MailItem = (MailItemPtr)(Outlook->CreateItem(Outlook_2k_olMailItem));  
MailItem->set_To((MailAddressee.w_str() ));
  MailItem->set_Subject((MailSubject.w_str()));
  MailItem->set_Body((MailFullText.w_str()) );
  MailItem->Attachments->Add( (TVariant)(FDispatch_path), TNoParam(), TNoParam(), TNoParam() );

  MailItem->Send();
}`

` this is the one of the many errors

[ilink32 Error] Error: Unresolved external '__fastcall Outlook_2k::TSyncObject::Disconnect()' referenced from C:\mypath\OUTLOOK_2K_SRVR.OBJ [ilink32 Error] Error: Unable to perform link

Thanks in advance

I tried to re-compile "Outlook_2k_SRVR.obj" with the .h file that comes in the vcl folder but no luck.

Aucun commentaire:

Enregistrer un commentaire