[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
WhatLinksHere » node » WindowsFAQ » handle » CppArray » constant » motherboard » games » assembly » microprocessor » 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"); 


last edited (November 18, 2006) by bilderbikkel, Number of views: 4139, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Site Management by Lars Hagelin at Kontantkort.se.