我是程序如下
private void btnSend_Click(object sender, System.EventArgs e)
{
MailMessage message = new MailMessage();
message.From = txtSender.Text;
message.To = txtRecipient.Text;
message.Subject = txtSubject.Text;
message.Body = txtBody.Text;
try
{
SmtpMail.SmtpServer = "";
SmtpMail.Send(message);
}
catch(Exception ex)
{
Response.Write(ex.Message);
}
private void btnSend_Click(object sender, System.EventArgs e)
{
MailMessage message = new MailMessage();
message.From = txtSender.Text;
message.To = txtRecipient.Text;
message.Subject = txtSubject.Text;
message.Body = txtBody.Text;
try
{
SmtpMail.SmtpServer = "";
SmtpMail.Send(message);
}
catch(Exception ex)
{
Response.Write(ex.Message);
}
解决方案 »
- 这两条更新语句如何合并一条 请教
- 如何给TreeView的添加一个图片列?
- <%# Eval("[title]") %>
- 怎么通过字段名取得其在GridView中处于第几列?
- 后台代码的变量赋值到前台,应该挺简单的,但还是没有调对……兄弟们帮下忙
- ASP.NET的页面没办法加客户端JS代码啊?!
- 终于搞出来了。。支付宝接口程序参数问题
- 求教关于iis问题
- jquery ajax返回错误
- 我的asp.net网站程序在本机运行都可以,放到虚拟主机上就出错,各位大哥帮帮忙看看是什么问题
- 请帮我解决一个数据库的连接问题
- 求RegularExpressionValidator的ValidatorExpression详细说明文章!
I have not solve the problem yet.
Configuration conf=new ConfigurationClass();
conf.Fields[CdoConfiguration.cdoSendUsingMethod].Value=CdoSendUsing.cdoSendUsingPort;
conf.Fields[CdoConfiguration.cdoSMTPServer].Value="smtp.21cn.com";
conf.Fields[CdoConfiguration.cdoSMTPServerPort].Value=25;
conf.Fields[CdoConfiguration.cdoSMTPAccountName].Value="hydnoahark";
conf.Fields[CdoConfiguration.cdoSendUserReplyEmailAddress].Value="\"c_zc\" <[email protected]>";
conf.Fields[CdoConfiguration.cdoSendEmailAddress].Value="\"c_zc\" <[email protected]>";
conf.Fields[CdoConfiguration.cdoSMTPAuthenticate].Value=CdoProtocolsAuthentication.cdoBasic;
conf.Fields[CdoConfiguration.cdoSendUserName].Value="c_zc";
conf.Fields[CdoConfiguration.cdoSendPassword].Value="******";
conf.Fields.Update();
MessageClass msg=new MessageClass();
msg.Configuration=conf;
msg.To="[email protected]";
msg.Subject="收到否";
msg.TextBody="It's test";
msg.From="[email protected]";
而不想用楼上仁兄提供的方法。
> Right click on the default SMTP Server, select Properties
SMTP的配置也没有什么问题,都是按默认值设置的也没有其他的错误提示了,就是Exception.Message是未能访问“CDO.Message”对象
有问题再联系