易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net 发送邮件

C# code:

string to = "abc@sina.com";
string from = "mathieuxiao@yahoo.com.cn";
string subject = "Using the new SMTP client.";
string body = @"Using this new feature, you can send an e-mail message from an application very easily.";
MailMessage message = new MailMessage(from, to, subject, body);
// SmtpClient client = new SmtpClient("smtp.sina.com.cn");
SmtpClient client = new SmtpClient();
client.Host = "202.108.3.190";
client.Port = 25;

client.Credentials = new System.Net.NetworkCredential("abc@sina.com", "123456");
try
{
client.Send(message);
}
catch (Exception ex)
{
Response.Write("<script language='javascript'>alert('" + ex.Message + "')</script>");
}

上面的代码生成没有问题,但是就是不能正确接收到邮件。


不懂,jf

csdn的很多朋友都在问发送邮件的问题。

代码一般都没啥问题,随便一Google都可以找一大堆。

首先必须要确定一件事情,你的邮件的smtp开通了吗?

配置到outlook里试试。




使用QQ,Gmail邮箱试试
smtp可能不支持,或用jail试试

jmail试试
jmail.Message j = ne


相关问答:

asp.net分页问题

select top 12 * from Product where [id] not in (select top 12 [id] from Product)
这样可以分页,但是我在后面想加个条件
select top 12 * from Product where [id] not in (select top 12 [id] from Prod ......

asp.net 将excel表的内容插入到数据库

在c#里,
我做的是底层的插入。
实体层,数据层,业务层已经有表的属性了,
要实现将excel表里的内容插入到已有的数据库的某一表中。
比如excel表里有属性A,B,C,D,E
数据库里的表的名字是excelTable ......

帮忙推荐一本ASP.NET的书,谢谢!

比较好的学习asp.net的书推荐一下吧,谢谢~~~
書的話等高人推薦, 我認為多上上www.asp.net對你幫助挺大, 那里有很多視頻, 如果是新手的話, 視& ......

谁有于海涛ASP.NET的全套视频(免费)

RT。很多地址都打不开或不能下载了
有资源的朋友给个地址。。只要下载后是我想要的内容 50分献上!
谢谢!
沙发我先坐!


帮顶

帮顶
没听说过哦

JF

好像19没有的,不全。

好多集都不能下。。
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号