I have been trying to use the code in powershell below to test a send email using the webservice.
As it appears according to this tool.
https://testconnectivity.microsoft.com
Autodiscover is not setup.. which I'm being told it is, but the tool tells me another story...
Well, I would rather bypass the Autodiscovery item if at all possible...
code sample:
using System;
using Microsoft.Exchange.WebServices.Data;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange<version and SP> );
service.EnableScpLookup = false;
service.Credentials = new WebCredentials("username", "pass", "domain");
service.TraceEnabled = true;
service.TraceFlags = TraceFlags.All;
// # Commented out service.AutodiscoverUrl("Email account");
service.Url = "https://<exchange url>/EWS/Exchange.asmx";
EmailMessage email = new EmailMessage(service);
email.ToRecipients.Add("<a href="mailto:emailaccount@.com">emailaccount@<email>.com");
email.Subject = "HelloWorld";
email.Body = new MessageBody("This is the first email I've sent by using the EWS Managed API");
email.Send();
}
}
}
Please let me know if it is possible not to use autodiscovery .... and if there is a way to get this code to send email.. As I would later add a step to get the email downloaded to a sharepoint and or a file once I'm able to access the inbox.