我想使用 Gmail 发送电子邮件,但出现以下异常
尝试对无法访问的网络进行套接字操作 [2a00:1450:400c:c05::6d]:465
你知道如何解决它吗?
MailMessage msg = new MailMessage();
msg.From = new MailAddress("test@yahoo.com");
msg.To.Add("test@yahoo.com");
msg.Subject = this.txtSubject.Text;
msg.Body = this.txtBody.Text;
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.Port = 465;
client.EnableSsl = true;
client.Send(msg);