我只是试图通过microsofts示例(https://msdn.microsoft.com/en-us/library/office/dn567668(v=exchg.150).aspx#Create),他们发送电子邮件,我在
上收到错误email.send();
我不明白为什么.. 你们中的任何人都是一样的吗?我正在使用Xamarin Studio并且非常绝望。
继承我的代码:
using System;
using Microsoft.Exchange.WebServices.Data;
namespace consoleprosjekt
{
class MainClass
{
public static void Main (string[] args)
{
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new WebCredentials("xxxx@xxxx", "xxxx");
service.TraceEnabled = true;
service.TraceFlags = TraceFlags.All;
service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
EmailMessage email = new EmailMessage(service);
email.ToRecipients.Add("snorri.engen@gmail.com");
email.Subject = "HelloWorld";
email.Body = new MessageBody("This is the first email I've sent by using the EWS Managed API");
email.Send();
}
}
}