[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppVclSendEmail
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppVclSendEmail
(C++ VCL) Send E-mail
There are multiple ways to send E-mails.Using the TNMSMTP Component
The TNMSMTP Component can be found under the FastNet tab in the Component Palette. When you correctly set its properties, the code you need is:NMSMTP1->Connect(); NMSMTP1->SendMail(); NMSMTP1->Disconnect();
Using OLE objects to use Microsoft Outlook Express
Found out by Rowin and posted this at the C++ Builder Message Board here:
Variant MSOutlook ;
Variant MailMessage ;
MSOutlook = CreateOleObject("Outlook.Application") ;
MailMessage = MSOutlook.OleFunction("CreateItem" , (Variant)0) ;
MailMessage.OlePropertySet("TO" ,"BritneySpears@hotmail.com" ) ;
MailMessage.OlePropertySet("Subject" , "Testing Mail!!!") ;
MailMessage.OlePropertySet("Body" , "The test is successful :)" ) ;
MailMessage.OleFunction("Send");
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
