String[] Sendto = File.ReadAllLines("SendTo.txt");
SmtpClient X = new SmtpClient("smtp.gmail.com", 587);
//X.UseDefaultCredentials = false;
NetworkCredential Auth = new NetworkCredential("Someone@gmail.com", "Plainttext password");
X.Credentials = Auth;
X.EnableSsl = true;
foreach (string recip in Sendto)
{
try
{
MailAddress from = new MailAddress("Someone@gmail.com");
MailAddress to = new MailAddress(recip);
MailMessage myMail = new MailMessage(from, to);
myMail.Priority = MailPriority.High;
myMail.Subject = "Your Test is Done";
myMail.SubjectEncoding =
myMail.BodyEncoding = System.Text.Encoding.UTF8;
myMail.IsBodyHtml = true;
X.Send(myMail);
}
catch (Exception ex)
{ Console.WriteLine(ex.Message); }
なぜこれが機能しないのですか?トラフィックを盗聴しました。smpt.google.com から dns 応答を受け取りましたが、リモート サーバーへの接続に失敗しました