Hi,
the exchange server im trying to connect with Smtp to send a mail fails with "'test-user' is not a valid email address. Parametername: address"
Why i cannot use simple usernames? Our usernames are NOT email addresses.
Code snippet i use:
// creds is a string array in this case {[AUTHTYPE], [USERNAME], [PASSWORD], [SERVERNAME_EXCHANGE]}
// in this example creds={"Normal", "test-user", "abc123def", "mailhost.mydomain.com"}
using (Smtp client = new Smtp())
{
string server = creds[3];
try
{
client.ConnectSSL(server);
}
catch
{
client.Connect(server);
client.StartTLS();
}
if (creds[0] == "OAuth2") // remove if authentication is not needed
{
client.LoginOAUTH2(creds[1], creds[2]);
}
else
{
client.UseBestLogin(creds[1], creds[2]);
}
...