I need to build a Windows program with Visual C++ that sends an SMTP email when an alarm condition occurs. I will be reading data out of several PLCs (automation controllers) with the help of active-x controls purchased earlier for other projects.
New to Visual C++, (I'm mostly an old VB6 guy) I love the terse and powerful syntax of C, so I will be migrating to VC++ as time allows. C# bites, I'd rather stop programming than use that...
I have some code for a console application that works OK, so if no one has an example of SMTP email using C++, maybe someone has a way to run a separate command line exe from within a Windoze Forms program.
I have done some lengthy reading in winsock2.h but have to admit being a both overwhelmed (and ignorant) about how to interpret it to create code that uses it.
I was further confused when I placed the statement
include <winsock2.h>
in my program; I get a jillion errors about redefinitions that refer to ws2def.h
Well... I'm not sure how ws2def.h got in the mix to start with, possibly during the selection of project type... I dimly recall check boxes referring to things that may have included winsock.
All of that to say just this: I need some help from someone using Visual C++ 2010 to get me over the hump for SMTP email. I've put in lots of hours learning how to work with text files, forms, etc. and am getting encouraged (finally) about being able to produce more useful programs. Right now though, I'm just as stuck as I was two weeks ago... up to the axles!
Thank you for your thoughtful consideration of this; there is precious little on the subject other than "BUY MY EMAIL CONTROL FOR ONLY $99.99".