Updated SMTP Class | CodeGuru

Updated SMTP Class

I was really happy to see thoses class for smtp’s transactions. One thing I didn’t have in my own smtp object was the file transfert with MIME specifications. The only thing the Wes Clyburn’s class missed is the use of CC ad BCC. Since it’s more easy to add those things than adding the file […]

Written By
CodeGuru Staff
CodeGuru Staff
Dec 18, 1998
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

I was really happy to see thoses class for smtp’s transactions. One
thing I didn’t have in my own smtp object was the file transfert with
MIME specifications. The only thing the Wes Clyburn’s class missed is
the use of CC ad BCC. Since it’s more easy to add those things than
adding the file transfer functionality to my own class, I decided to
take the Wes Clyburn object and modified it.

These modifications have been done to enhance the real good object
CMailMessage, with the functionnality of CC and BCC copy and in the
context of keeping the same public interface.

All new parameters are only optionnal. Still thanks to Wes Clyburn.

How to use ?

Still the same function, but with optional arguments that will change the recipients list. You have three kinf of recipients.

	CMailMessage::TO (the default one)
	CMailMessage::CC
	CMailMessage::BCC

	//*** Example..CMIMEMessage msg;
	msg.AddMultipleRecipients( "banana@culture.com" );
	msg.AddMultipleRecipients( "president.of.banana@culture.com,CMailMessage::CC );
	msg.AddMultipleRecipients( "secret@banana.eater", CMailMessage::BCC );

	...

The reste remains the same.. Voila !!!

Download source – 16KB

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.