Modem Communication & POP

In C++ how do I communicate with modem and create my own e-mail programme using POP (Post Office Protocol)?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Best way : use MAPI Api
next is simple example of sending
message in Mapi.
Send EMail
In one of the function, you need to get pointers to the MAPI functions. e.g.

HINSTANCE hlibMAPI = LoadLibrary (MAPI32.DLL); // assuming you are using Win32 environment.

m_MAPILogon = (LPMAPILOGON) GetProcAddress (hlibMAPI, "MAPILogon");
m_MAPILogOff = (LPMAPILOGOFF) GetProcAddress (hlibMAPI, "MAPILogoff");
m_MAPISendMail = (LPMAPISENDMAIL) GetProcAddress (hlibMAPI, "MAPISendMail");

Then you need to logon to MAPI.... using logon function.

LPSTR lpszProfileName;
LPSTR lpszPassword;

HRESULT hRes = m_MAPILogon (
0L, // Handle to parent window or 0.
lpszProfileName, // Default profile name to use for MAPI session.
lpszPassword, // User password for MAPI session.
flags, // Various session settings
ulReserved, // Reserved.  Must be 0L.
&m_lhSession // Return handle to MAPI Session

CEmailApp::SendMail ()
FLAGS flags;
ULONG ulReserved = 0L;
ULONG cRecips = 0L;
MapiRecipDesc recips;
MapiMessage message;

ZeroMemory (&message, sizeof (MapiMessage));
ZeroMemory (&recips, sizeof (MapiRecipDesc));

if (m_lhSession != NULL) {
// recipient description.
recips.ulReserved = ulReserved;
recips.ulRecipClass = MAPI_TO;
recips.lpszName = _T ("Naveen");
recips.lpszAddress = _T ("");

// Message description.
message.lpszSubject = (LPSTR) "My Subject";
message.lpszNoteText = (LPSTR) "Testing MAPI application";
message.nRecipCount = 1L;
message.lpOriginator = NULL;
message.nFileCount = 0L;
message.ulReserved = ulReserved;
message.lpRecips = &recips;

flags = ~MAPI_DIALOG;

hRes = m_MAPISendMail (m_lhSession, 0L, &message, flags, ulReserved);
if (hRes != SUCCESS_SUCCESS) {
SetErrorMessage (hRes);
else {
TRACE (_T ("There is no active MAPI Session!\n"));
SetErrorMessage (hRes);

FreeBuffer (&message);
FreeBuffer (&recips);

return hRes;

At the end, log off from MAPI

m_MAPILogOff (m_lhSession, 0L, 0L, 0L);

If you want, i can send you full
example (write you EMail)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
smsaleemAuthor Commented:
I would be glad if the code is meant for DOS environemtn and not for Windows.
O, Dos! You must write about it
in text of Question!
for Dos Libraries for POP3 protocol
(but not free!).
smsaleemAuthor Commented:
Thank you that's what I suspected!
My e-mail is
OK, i am very glad to help you.
Don't forget evaluate the reply.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.