需要从本地PC发送测试电子邮件

时间:2017-05-27 12:50:19

标签: smtp

我正在开发一个发送电子邮件的ASP.Net Web应用程序,但是在周末从家里做这件事并且无法访问我组织的smtp服务器来发送邮件。通过应用程序向我自己发送测试电子邮件有哪些选择?我尝试使用我的凭据和ssl端口号插入Google的smtp设置,但是当我这样做时,我在事件查看器中得到以下异常:

Exception information: 
Exception type: IOException 
Exception message: Unable to read data from the transport connection: net_io_connectionclosed. at system.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpClient.GetConnection()

在System.Net.Mail.SmtpClient.Send(MailMessage消息)

我想知道我现在有什么选择。是否有可用于向自己发送邮件的公共SMTP服务器/服务?

编辑 - 我尝试了一些基于其他帖子的额外smtp设置:

<network enableSsl="true" password="XXXXX" userName="XXXXX@gmail.com" host="smtp.gmail.com" port="587" />

但我仍然得到一个例外,虽然是另一个例外:异常信息:


    Exception type: SmtpException 
    Exception message: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
   at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
   at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode)
   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at Tricare.handlers.ContactUs.SubmitForm() in c:\TFS\Tricare\Upgrade-branch\Website\handlers\ContactUs.ashx.cs:line 201
   at Tricare.handlers.ContactUs.ProcessRequest(HttpContext context) in c:\TFS\Tricare\Upgrade-branch\Website\handlers\ContactUs.ashx.cs:line 47
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

1 个答案:

答案 0 :(得分:0)

https://websocket.email执行您想要的操作并接受没有凭据的电子邮件,并允许您在测试电子邮件到达时进行轮询。