Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I want to import contacts into a mailbox (exchange server) from my DB and that contacts should be access from anywhere when user login to that email.

Unlike outlook that remains limited for specific computer.

What I have tried:

I tried nothing as I don't get anything to try.
Posted
Updated 3-Oct-17 4:21am
v5
Comments
Dave Kreskowiak 2-Oct-17 11:52am    
Import from what?
IamWsk 2-Oct-17 11:54am    
From my Asp.net application to Mailbox contacts.
I have the credential for that mailbox
Dave Kreskowiak 2-Oct-17 12:07pm    
What "Mailbox"?
IamWsk 3-Oct-17 4:10am    
Mailbox in the sense a exchange server mailbox.
IamWsk 3-Oct-17 4:16am    
For example I have number of emails in my DB and I want to push those emails in the email's (abc@xyz.com) contact list through my Asp.net page.

1 solution

I got the solution
here is my code
C#
ExchangeService service = new ExchangeService();
service.Credentials = new NetworkCredential(username, password);
service.AutodiscoverUrl(emailaddress);
Contact contact = new Contact(service);
contact.GivenName = "ABC";
contact.Surname = "XYZ";
contact.FileAsMapping = FileAsMapping.SurnameCommaGivenName;
contact.PhoneNumbers[PhoneNumberKey.HomePhone] = "";
contact.EmailAddresses[EmailAddressKey.EmailAddress1] = new EmailAddress("abc@yourdomain.com");
contact.Save(WellKnownFolderName.Contacts);
 
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