Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I've been porting an old C++/MFC program that worked under windows 98.
Each time something wrong happens (user fault) the program sends automatically an e-mail to several accounts in order to allow them to follow the issue.

My development machine is a W7 and when I try to send an e-mail I get a dialog asking for my permission on that action. This was not happening in windows 98, and seems to be due to the new safety measures that Microsoft has implemented into the new operating systems.

As the mail functionality in this program is to alert of a wrong behavior, sending the e-mail should not be optional and that should not require the user intervention.

Searching in the Internet I've found a MAPI class (here at CP from Noel Dillabough) but it seems that without Outlook installed it can't work (this is not a super problem in my case); but, apart of that I have to keep Outlook open in order to allow it to send the messages even the app gets the messages in the "outbound box". (and this is a big problem).

After trying that I've seen a class that worked with SMTP directly (again here at CP but this time from Nish) and that one seemed perfect, but written in ATL and therefore I can't use it in the MFC app I'm using as it seems that I can't add support for ATL (it fails at the end returning me a 0x80004005 (E_FAIL))...

So at this point... what would recommend me to be able to send e-mails without:
- Needing Outlook opened.
- Having to validate popup dialogs.
- Installing programs that surpass this kind of security.

?

Thank you in advance for your help!
Posted
Updated 22-Apr-12 21:19pm
v2

1 solution

Well,

At the end I've solved it "by myself"...

I've found a class from PJ Naughter that makes wonders and that works with MFC using SMTP, so problem solved.

You can see the class here: CSMTPConnection v1.36[^]. (look at "Contacting the author" where the link to the site where the newest class is stored).

At the end problem solved. :thumbsup:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900