不能发送电子邮件无法连接远程服务器 [英] Fail Sending Email Unable To Connect the Remote Server

查看:243
本文介绍了不能发送电子邮件无法连接远程服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时消息发送电子邮件时,面对错误。这里是误差

什么是这个例外,因为我新受在此,这里的路实际的错误是我的code线:

 尝试
                昏暗SMTPSERVER作为新SmtpClient()
                昏暗的邮件作为MAILMESSAGE新()                SmtpServer.Credentials =新_
                Net.NetworkCredential(test@gmail.com,passwordexample)
                SmtpServer.EnableSsl = TRUE
                SmtpServer.Port = 587
                SmtpServer.Host =smtp.gmail.com                邮件= MAILMESSAGE新()
                mail.From =新MailAddress(test@gmail.com)
                mail.To.Add(examplemail@gmail.com)
                mail.Subject =变更申请已提交
                mail.Body =尊敬的用户,与& Environment.NewLine&安培; Environment.NewLine&安培; Environment.NewLine&安培; Environment.NewLine&安培; 一个通知已经提交,&放大器; Environment.NewLine&安培; 请检查在Intranet应用程序的变更请求//广告这一行的错误SmtpServer.Send(邮件)
                SmtpServer.EnableSsl = TRUE
                MSGBOX(通知通过电子邮件发送成功)
            抓住EX为例外
                MSGBOX(ex.ToString)
            结束Try


解决方案

请看看这个答案......

<一个href=\"https://stackoverflow.com/questions/22814590/sending-email-from-visual-basic/22853475#22853475\">Sending从Visual Basic 电子邮件

如果您仍然不能发送电子邮件....

是否启用POP或IMAP在Gmail中?
登录到Gmail网络interface.Open你的设置页面上的转发和POP / IMAP标签,然后配置IMAP或POP。在Gmail中启用此之后,请务必点击保存更改,这样,Gmail可以与您的邮件客户端通信。

如果你有2两步验证。

获取应用程序专用密码
谷歌会自动生成你将需要只有一次,当你设置谷歌邮件您的移动设备或电子邮件软件上的密码。您可以轻松地生成您要使用每个设备或电子邮件软件的密码。

第1步:
在两步骤验证屏幕的底部,旁边是特定于应用程序的密码,单击管理应用程序专用密码。你的谷歌帐户的屏幕进行授权访问将被打开。

步骤2:
在你的谷歌帐户的屏幕进行授权访问,在名称字段中,输入一个名称,以帮助你记住你正在使用访问您的帐户,然后点击生成密码什么应用。然后你会看到你会用它来配置您的移动设备或电子邮件软件的密码。保持此屏幕打开,直到您准备输入密码(见第4部分,下同)。密码生成与设备名称会显示在底部。当您使用密码完成后,单击完成。

步骤3:
要设置其他设备或电子邮件软件密码,只需在名称字段中键入它的名称,然后单击生成密码。您将收到一个新的密码。

请参阅更多...

<一个href=\"http://www.oit.umass.edu/support/google-apps/configure-google-mail-email-software-mobile-devices\" rel=\"nofollow\">http://www.oit.umass.edu/support/google-apps/configure-google-mail-email-software-mobile-devices

im facing error when sending email. here is the error

what is the actual error for this exception because i newbie in in this, by the way here is my code line:

 Try
                Dim SmtpServer As New SmtpClient()
                Dim mail As New MailMessage()

                SmtpServer.Credentials = New  _
                Net.NetworkCredential("test@gmail.com", "passwordexample")
                SmtpServer.EnableSsl = True
                SmtpServer.Port = 587
                SmtpServer.Host = "smtp.gmail.com"

                mail = New MailMessage()
                mail.From = New MailAddress("test@gmail.com")
                mail.To.Add("examplemail@gmail.com")
                mail.Subject = "Change Request Submitted"
                mail.Body = "Dear User, " & Environment.NewLine & Environment.NewLine & Environment.NewLine & Environment.NewLine & "One Notification have been submitted," & Environment.NewLine & "Please check the change request on the intranet application"

//ad this line the error SmtpServer.Send(mail)
                SmtpServer.EnableSsl = True
                MsgBox("Notification emailed successfully")
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try

解决方案

Please see this answer...

Sending Email from Visual Basic

If you still can't send the email....

Have you enabled POP or IMAP in Gmail? Sign in to the Gmail web interface.Open the 'Forwarding and POP/IMAP' tab on your 'Settings' page, and configure IMAP or POP. After enabling this in Gmail, make sure you click 'Save Changes' so Gmail can communicate with your mail client.

If you have 2 step verification..

Get an Application-Specific Password Google will automatically generate a password that you will need only once, when you set up Google Mail on your mobile device or email software. You can easily generate a password for each device or email software you want to use.

Step 1: At the bottom of the 2-step verification screen, next to Application-specific passwords, click Manage application-specific passwords. The Authorized Access to your Google Account screen will open.

Step 2: On the Authorized Access to your Google Account screen, in the Name field, type in a name to help you remember what application you are using to access your account and click Generate password. You will then see a password which you will use to configure your mobile device or email software. Keep this screen open until you are ready to enter the password (see part 4, below). The password creation with the device name will show at the bottom. When you are done using the password, click Done.

Step 3: To set up a password for another device or email software, simply type in the name of it in the Name field and click Generate password. You will receive another password.

See more here...

http://www.oit.umass.edu/support/google-apps/configure-google-mail-email-software-mobile-devices

这篇关于不能发送电子邮件无法连接远程服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆