C#WebアプリケーションからActive Directory配布グループに電子メールを送信するにはどうすればよいですか?
-
08-07-2019 - |
質問
Active Directory配布グループに電子メールを送信しようとしています。
次のような方法でメールを送信できることを知っています:
mail.From = new MailAddress("steveb@microsoft.com");
mail.To.Add("billg@microsoft.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is a sample body with html in it.";
mail.IsBodyHtml = true;
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
// i seem to need this too....
smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
smtp.Send(mail);
しかし、 To
フィールドの(有効な)ADグループ(" My Test Group"など)を使用しようとすると、有効なメールアドレスではないため、無効になります。
これは本当に簡単だと確信していますが、行き詰まっているようです...
ありがとう
解決
配布グループにはメールアドレスがあります。これは「to」パラメーターに追加する必要があります。
所属していません StackOverflow