MailMessage aMessage = new MailMessage ( ) ;
//新建一个MailMessage对象
aMessage.From = "[email protected]" ;
//定义发信人地址,如果是多人,可以用","分开
aMessage.To = txtSendTo.Text ;
aMessage.Subject = txtSubject.Text ;
//定义邮件的主题
aMessage.Body = txtContent.Text ;
//定义邮件的内容
SmtpMail.Send ( aMessage ) ;
//发送电子邮件
MessageBox.Show( "电子邮件已经发送到->" + txtSendTo.Text ) ;
程序没出任何错误,但是就是收不到邮件我是winform的程序
//新建一个MailMessage对象
aMessage.From = "[email protected]" ;
//定义发信人地址,如果是多人,可以用","分开
aMessage.To = txtSendTo.Text ;
aMessage.Subject = txtSubject.Text ;
//定义邮件的主题
aMessage.Body = txtContent.Text ;
//定义邮件的内容
SmtpMail.Send ( aMessage ) ;
//发送电子邮件
MessageBox.Show( "电子邮件已经发送到->" + txtSendTo.Text ) ;
程序没出任何错误,但是就是收不到邮件我是winform的程序
解决方案 »
- .net office开发高手请进
- 一个很怪的现象
- C# 调用DLL 参数包括结构,结构中包括结构数组,且有定长字符串
- 系统的学习WCF有没有什么好书?
- SmtpClient发送邮件,附件不在163详细页显示!(公司新人第一次独立做东西,大家帮忙)
- Substring的一个问题
- 网上收集并整理的2个winform小组件(多选节点树 和 非绑定属性guid)
- [求助]DataGridView进行单元格数据验证时,如何获得原数据?
- 100求助一个路径算法(应该算比较简单吧,只是我数学太差)
- {"并发冲突:UpdateCommand 影响 0 个记录。" }--这是什么原因呢?--请帮忙!
- 问个很弱的问题--在winForm下如何获得程序运行的当前路径?
- 两表联合查询的时候用RowFilter,出错提示:索引0处没有值
Configuration conf=new ConfigurationClass();
conf.Fields[CdoConfiguration.cdoSendUsingMethod].Value
=CdoSendUsing.cdoSendUsingPort;
conf.Fields[CdoConfiguration.cdoSendEmailAddress].Value="[email protected]";
conf.Fields[CdoConfiguration.cdoSendPassword].Value="xxxxxx";
conf.Fields[CdoConfiguration.cdoSMTPServer].Value="mail.xxx.xxx";
conf.Fields[CdoConfiguration.cdoSendUserName].Value="[email protected]";
//发送者名称,这一项要注意检查,不可以乱写
conf.Fields[CdoConfiguration.cdoSMTPServerPort].Value=25;
conf.Fields[CdoConfiguration.cdoSMTPAuthenticate].Value
=CdoProtocolsAuthentication.cdoBasic;
conf.Fields.Update();
</p>
这里用的是哪个网站的邮箱,你那个smpt.server指定的吗啊??
会造成一些邮件服务器把你发的邮件当成垃圾
SMTP服务器的指定SmtpMail.SmtpServer="localhost";后面是你的服务器,我是用自己的IIS做的