嘿,我正在尝试使用gmail.com中的vb.net发送文件,但问题是我收到了“时间段错误,或者由于连接的主机无法响应64.233.166.108:567,建立的连接失败” “
我不确定问题是什么,我在任何地方都找不到答案:(
感谢您的帮助!
代码:
Using mail As New MailMessage
mail.From = New MailAddress("....@gmail.com")
mail.To.Add("........@gmail.com")
mail.Body = "Computer info Below"
Path = "C:\Users\" & Environment.UserName & "\Pictures\hello.txt"
Dim attach As New Attachment(Path)
mail.Attachments.Add(attach)
mail.Subject = Environment.UserName
mail.Priority = mail.Priority.Normal
Using SMTP As New SmtpClient
SMTP.EnableSsl = True
SMTP.Port = "567"
SMTP.Host = "smtp.gmail.com"
SMTP.Credentials = New Net.NetworkCredential("....@gmail.com", "******")
SMTP.Send(mail)
End Using
End Using