[Webinar] Learn how to a build a cloud-first strategyRegister Now


Exchange mails (sending + receiving) on not-logged-on account, VC++ 6.0

Posted on 2006-04-12
Medium Priority
Last Modified: 2010-04-01
I need to log on to an Exchange server to check my Inbox, copy the content of the mails to a text file and move the mails into an archive folder. Also I must be able to send mails.

Big Problem: The exchange mail account belongs to another windows user account.

I am Administrator, have full rights and would (if needed) hardcode all login / password stuff for the mail account ("tsdp"). But I haven't managed yet, I guess i must first impersonate myself before I can operate. Or ? I have no exchange password, only the windows user account password, but did never manage to come into the mail account.

Do I have to add an additional mail profile in order that it works ?

I use Visual C++ 6.0 / Visual Basic 6.0, what technique would allow me the most technically-up-to-date stuff and flexibility ? (no, I mean  not ".NET" and not web service stuff like ADO)  CDO 1.2.1 ? Or some MAPI functions ? I need some code snippets that help me perform this task.
Question by:PC-Alex
LVL 86

Expert Comment

ID: 16438082
You should be able to specify any arbitrary Exchange user name when calling 'MAPILogon()' or 'MAPILogonEx()' independent from the Windows account you're using. See also the samples at http://www.codeproject.com/internet/#MAPI and http://www.codeproject.com/internet/xymailclient.asp ("Sending and receiving e-mails from your program") in particular.

Author Comment

ID: 16514374
Thanks for the tips, jkr, codeproject was also my first source to examine.

I just found out that the problem was due to missing rights on the exchange account: I am member of the Admin group, I am entitled to "send as" on this account, I had an additional mail profile for this box ... but that was not enough.

I had to make the check box in Active Directory Users und Computers, "View" / "Advanced Features", to be able to see "Exchange Advanced", where I can give me the "Permissions for tsdp". That was it.

I have documented the full details on http://www.a-m-i.de/tips/automation/mailautomation.php (in german)

Accepted Solution

GranMod earned 0 total points
ID: 16727056
PAQed with points refunded (500)

Community Support Moderator

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question