发送电子邮件vb.net时出错

时间:2011-12-09 00:28:25

标签: asp.net vb.net email

连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机无法响应67.69.240.69:25

    Dim smtpClient As New SmtpClient()
    Dim message As New MailMessage()
    Dim fromAddress As New MailAddress("news@ffff.ca")
    smtpClient.Host = "smtp10.bellnet.ca"
    smtpClient.Credentials = New NetworkCredential("news", "1235!")

    smtpClient.Port = "25"
    message.From = fromAddress
    message.To.Add("khs@ddddd.com")
    message.Subject = "eyjeyjey afsdf"

    message.Body = "Hello from aaaaa"
    message.IsBodyHtml = True
    smtpClient.EnableSsl = True
    smtpClient.Send(message)

1 个答案:

答案 0 :(得分:1)

Bell Canada阻止默认的SMTP端口为25。

有关部分列表,请参阅this link