我在 Visual Basic 中制作了一个邮件客户端(2008 如果重要的话),它在我尝试过的一台笔记本电脑上完美运行,但在另一台笔记本电脑上它给了我消息:“发送邮件失败” 什么会导致这个问题?我不认为这是防火墙,因为我尝试在它不起作用的计算机上关闭防火墙,但这并没有解决任何问题。
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
Try
Dim smtpServer As New SmtpClient("smtp.aol.com")
Dim Mail As New MailMessage()
smtpServer.UseDefaultCredentials = False
smtpServer.Credentials = New Net.NetworkCredential("Email", "Pass"
smtpServer.Port = 587
smtpServer.Host = "smtp.aol.com"
smtpServer.DeliveryMethod = SmtpDeliveryMethod.Network
smtpServer.EnableSsl = True
Mail.From = New MailAddress("Email")
Mail.To.Add("Email")
smtpServer.Send(Mail)
Catch Ex As Exception
MsgBox(Ex.Message)
End Try