This code is a C++ class derived from the ATL class
CSMTPConnection. It adds LOGIN authentication It also allows specifying a custom SMTP port.
The base class is described in detail here.
SMTP negotiating is described here.
Using the Code
Create a Windows project in Visual Studio 2005 and make sure you add ATL support. Create a
CAuthSMTPConnection variable and use the
CMimeMessage is already defined in the ATL libraries and the base class is already set to handle it.
msg.AddText("Use CAuthSMTPConnection to authenticate SMTP!");
AfxMessageBox("Mail not sent");
AfxMessageBox("Can't connect to mail server");
- 11/10/09 - Article created
- 11/11/09 - Cleaned up some insecure code
- 04/24/12 - Added support for VS2008
I've worked for the University of Oklahoma in the school of meteorology (Go SOONERS!), consulting, and now as a Senior Software Engineer. These things keep my lights on and electricity going. My dream job is to own a bowling alley and rub elbows with pro-bowlers! I'm also an avid pedicab driver and have my own cab. I like the hustle of picking up people in downtown and biking them to their destination.