通过SMTP发送邮件时发送邮件失败

时间:2014-12-22 09:27:11

标签: vb.net smtp windows-applications

  

Dim mail As New Net.Mail.MailMessage()

        mail.From = New Net.Mail.MailAddress("abc@xyz.com")
        mail.[To].Add("abc@xyz.com")
        mail.IsBodyHtml = True
        mail.Subject = "A subject line."
        mail.Body = "A mail body message."
        Dim smtp As New Net.Mail.SmtpClient("smtp.xyz.com", 25)
        smtp.Credentials = New System.Net.NetworkCredential("abc@xyz.com","password")
        Try
            smtp.Send(mail)
            MsgBox("Your Email has been sent sucessfully - Thank You")
        Catch exc As Exception
            MsgBox("Send failure: " & exc.ToString())
        End Try

在Windows应用程序中使用Credential的简单SMTP,抛出异常 -

发送邮件失败。

为什么投掷可以让任何人帮助我。

0 个答案:

没有答案