无法使用我的网络邮件发送电子邮件 [英] Can't Send E-Mail with my webmail

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

问题描述

在这里我尝试从我的网站发送电子邮件,并从谷歌中找到我使用它的代码,当我使用它与我的Gmail帐户它工作正常,但当我使用它与我的webmail帐户,它无法发送.. ...请帮助

  var  fromAddress =   dhiraj@xyz.in; 
// 电子邮件将发送的任何地址
var toAddress = xyz@yahoo.com;

const string fromPassword = 1234;
// 传递值并制作电子邮件格式以显示
string subject = test;
string body = From: + dhirajmane + \ n;
body + = 电子邮件: + dhiraj@xyz.in + \\\
;
body + = 主题: + hi dhiraj发送此邮件 + \\\
;
body + = 问题:\ n + 已启动 + \\\
;
// smtp设置
var smtp = new System.Net.Mail.SmtpClient();
{
smtp.Host = 103.21.58.111;
smtp.Port = 587 ;
smtp.EnableSsl = true ;
smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
smtp.Credentials = new NetworkCredential(fromAddress,fromPassword);
smtp.Timeout = 20000 ;
}
// 将值传递给smtp对象
smtp。发送(fromAddress,toAddress,subject,body);

Response.Write( 发送电子邮件!);



它出错了

无法发送电子邮件 - 错误:服务器不支持安全连接。

解决方案

因此,如果错误消息是服务器不支持安全连接,则意味着您必须禁用SSL(安全套接字)图层)。



更改此行:

 smtp.EnableSsl = true; 



到此:

 smtp.EnableSsl = false; 





希望这会有所帮助! : - )


我做

 smtp.EnableSsl = false; 


    check       link: 

< a href =http: // www.storm-consultancy。 COM /博客/开发/代码片段/发送电子邮件,用Gmail邮箱的SMTP服务器,在-ASP-NET /> HTTP://www.storm-consultancy.com/blog/development/code-snippets / sending-email-with-gmail-smtp-server-in-asp-net /< / a>

< a href =http: // stackoverflow.com/questions/454277/how-to-enable-ssl-换smtpclient合网络的配置> HTTP://stackoverflow.com/questions/454277/how-to -enable-SSL换smtpclient功能于web的配置< / A>


here i try to send e-mail from my website and find code from google i use it ,when i use it with my gmail account it works fine but when i use it with my webmail account it can't send .....pls help

var fromAddress = "dhiraj@xyz.in";
// any address where the email will be sending
var toAddress = "xyz@yahoo.com";

const string fromPassword = "1234";
// Passing the values and make a email formate to display
string subject = "test";
string body = "From: " + "dhirajmane" + "\n";
body += "Email: " + "dhiraj@xyz.in" + "\n";
body += "Subject: " + "hi dhiraj send this mail" + "\n";
body += "Question: \n" + "was up" + "\n";
// smtp settings
var smtp = new System.Net.Mail.SmtpClient();
{
    smtp.Host = "103.21.58.111";
    smtp.Port = 587;
    smtp.EnableSsl = true;
    smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
    smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
    smtp.Timeout = 20000;
}
// Passing values to smtp object
smtp.Send(fromAddress, toAddress, subject, body);

Response.Write("E-mail sent!");


it shoe the error
Could not send the e-mail - error: Server does not support secure connections.

解决方案

So if the error message is that the server does not support secure connections, it means that you are going to have to disable SSL (Secure Sockets Layer).

Change this line:

smtp.EnableSsl = true;


to this:

smtp.EnableSsl = false;



Hope this helps! :-)


i do

smtp.EnableSsl = false;


Please check the following link:

<a href="http://www.storm-consultancy.com/blog/development/code-snippets/sending-email-with-gmail-smtp-server-in-asp-net/">http://www.storm-consultancy.com/blog/development/code-snippets/sending-email-with-gmail-smtp-server-in-asp-net/</a>

<a href="http://stackoverflow.com/questions/454277/how-to-enable-ssl-for-smtpclient-in-web-config">http://stackoverflow.com/questions/454277/how-to-enable-ssl-for-smtpclient-in-web-config</a>


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

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