Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance forum
Viewing all articles
Browse latest Browse all 9032

How can access exchange server emails of my account in .NET code?

$
0
0

Hi All,

After lots of efforts, finally decided to put qustion on forum to resolve my problem.

Currently, My task is to access emails from my email account and download the specific email attachment which I will filter by using subject name of my email, It is clear to me.

But I am enable to access emails from exchange server(my email account use exchange server).

I did following to do my task:

1) Downloaded "EWS Managed API 2.0" and installed on my system.

2) Did following code:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new WebCredentials("myemailaddress", "userpassword");
service.AutodiscoverUrl("myemailaddress", RedirectionUrlValidationCallback);
EmailMessage message = new EmailMessage(service);
message.Subject = subjectTextbox.Text;
message.Body = bodyTextbox.Text;
message.ToRecipients.Add(recipientTextbox.Text);
message.Save();
message.SendAndSaveCopy();
System.Windows.MessageBox.Show("Message sent!");
recipientTextbox.Text = "";
subjectTextbox.Text = "";
bodyTextbox.Text = "";

But Above code giving error: "The Autodiscover service couldn't be located."

I have checked almost all the site and did the changes but no result.

Is to solve it, I need to do following:

1) Installation of Exchange server on my machine.

2) Adding "Autodiscover" name to DNS.

3) or any different.

My system configuration is as follows:

1) OS: Windows 2007 Professional

2) 32 bit system.

Now, everything is open from my side. Please give me your valuable suggestion on it.

Thanks



Viewing all articles
Browse latest Browse all 9032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>