public void EmailSending() {
MailMessage mail = new MailMessage();
mail.From = new MailAddress("[email protected]");
mail.To.Add("[email protected]");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
SmtpClient smtpServer = new SmtpClient("smtp.gmail.com");
smtpServer.Port = 587;
smtpServer.Credentials = new System.Net.NetworkCredential("[email protected]", "pw") as ICredentialsByHost;
smtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback =
delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
smtpServer.Send(mail);
Debug.Log("success");
}
私はこのエラーにのSocketException:そのようなホストは知られていない - 電子メールの送信に失敗しました - 団結
のSocketExceptionを取得しています:そのようなホストは知られていませんが。
System.Net.Dns.hostent_to_IPHostEntryあなたはanroidデバイスから送信している場合、私はあなたを考えて、その後 を
あなたはそのポート設定をどこから取得しましたか?あなたはポート '465'を試しました – Oxymoron
私は465を変えて、それはまだ同じエラーを表示します –