从gmail发送电子邮件. [英] Send an e-mail from gmail.

查看:183
本文介绍了从gmail发送电子邮件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

我要发送电子邮件时遇到问题.

我有以下代码:

Hello everyone.

I had a problem when I am going to send an e-mail.

I have the following code:

this.m_oSmtpCliente.Host = this.m_sSMTPSERVER;
this.m_oSmtpCliente.Port = 587;
this.m_oSmtpCliente.EnableSsl = true;
this.m_oSmtpCliente.DeliveryMethod = SmtpDeliveryMethod.Network;
this.m_oSmtpCliente.UseDefaultCredentials = false;
this.m_oSmtpCliente.Credentials = new System.Net.NetworkCredential(this.m_sUser, this.m_sPass);

this.m_oSmtpCliente.Send(oMessage);



当我执行最后一行时.我崩溃了,并给了我以下错误:



When I execute the last line. I crash and give me the following error:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 209.85.229.109:587
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)\r\n   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)\r\n   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)



我不知道发生了什么.我查看了很多代码,而我却是相同的.

非常感谢.



I don´t know what happend. I view a lot of codes and I was the same things.

Thank you very much.

推荐答案

反向查找显示,您提供的IP解析为FQDN ww-in-f109.1e100.net.这是您网络上的计算机吗?
要检查机器是否可以访问,您可以尝试对其执行ping操作.如果在网络中启用了ICMP,直到您尝试连接的计算机,这仅提供可靠的信息.仅当安装了至少在站点上启用并绑定到上述IP地址的Web服务器时,另一项测试才有效.如果最后一条语句为true,则可以尝试telnet 209.85.229.109 80.如果您的计算机可以访问服务器,则将使用telnet命令进行连接.

如果从计算机到端口587的服务器之间的telnet连接失败,并且您可以访问服务器,则可以尝试在服务器端进行telnet连接.如果这可行,则您知道从计算机到服务器的途中存在一些防火墙,该防火墙阻止了端口587.

如果在服务器端的端口587上的连接也失败,则您将知道该端口上没有正在运行的服务.

请进行调查,并在此评论中留下您的发现.
干杯!

—MRB
A reverse lookup revealed that the IP you gave resolves to the FQDN ww-in-f109.1e100.net. Is this a machine on your network?
To check if the machine is reachable you can try to ping it. This only gives reliable information if ICMP is enabled in your network up to the machine you are trying to reach. Another test only works if there is a web server installed with at least on site enabled and bound to the above mentioned IP address. If the last statement is true you can try telnet 209.85.229.109 80. If the server is reachable from your computer the telnet command will connect.

If a telnet connect from your computer to server at port 587 fails and you have access to the server you can try to do a telnet connect on the server side. If this works then you know that there is some firewall on the way from your computer to the server that is blocking port 587.

If the connect at port 587 also fails on the server side you know that there is no service running on that port.

Please investigate and leave your finding in comment to this post.
Cheers!

—MRB


我刚刚在系统上对其进行了测试,并且可以正常工作.唯一的区别是我没有在SMTP客户端中指定端口号.当非SSL的默认值为25,SSL类型的邮件的默认值为465时,为什么要在测试中选择端口587?
I have just tested this on my system and it works correctly. The only difference being that I did not specify a port number in the SMTP client. Why have you selected port 587 in your test, when the defaults are 25 for non-SSL and 465 for SSL type mail?


这篇关于从gmail发送电子邮件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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