MSMAIL Interface


We have Microsoft Mail Exchange server.
On Windows Client, we have MSExchange32 installed. From that windows client, using MAPI calls, we would like to send E - Mails without any user interface.

Currently we have achived this but it expects that user should have already opened MsExchange32.exe and logged into it with a user profile. After that we are able to send any number of e - mails from our program without any user interface.
Is it to possible to avoid logging into MSExchange?
How can I do it? Where can I find information regarding this.


Who is Participating?
Ten13Connect With a Mentor Commented:

You always need to login to be able to use MAPI (to send mail).
You can do this without user interface if you know the name of the profile yoy login with. Eg:

// remember to check for error ruturn codes!!!!!!
MAPILogon(hWnd, "Profile Name", "Password", 0, 0, &lhMAPISession);
MapiMessage MAPIMsg;
// fill out MAPIMsg here!!!
MAPISendMail(lhMAPISession, 0, &MAPIMsg, 0, 0);
MAPILogoff(lhMAPISession, 0, 0, 0);

If you don't know the profilename it is a problem. However you can write some code that creates a profile, then use that profile and the delete it again. I know how to do this, but never tired it.
See info on IProfAdmin.
Why not to use account name/password in MAPILogon() call?
coolbej1Author Commented:
Thanks a lot. We were using same APIs but still it was not working. We found that problem was because of different domains, one for login and a separate domain for Mailserver. Once we made these two domains same, problem was resolved.

Thanks a lot again
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.