用jmail发送邮件
System.Web.Mail.MailMessage myMail=new MailMessage();
myMail.From = "[email protected]";
myMail.To = "[email protected]";
myMail.Subject = "MailTest";
myMail.Priority = MailPriority.Low;
myMail.BodyFormat = MailFormat.Text;
myMail.Body = "Test";
SmtpMail.SmtpServer="smarthost";
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your password here
SmtpMail.SmtpServer = "mail.mycompany.com"; //your real server goes here
SmtpMail.Send(myMail);
System.Web.Mail.MailMessage myMail=new MailMessage();
myMail.From = "[email protected]";
myMail.To = "[email protected]";
myMail.Subject = "MailTest";
myMail.Priority = MailPriority.Low;
myMail.BodyFormat = MailFormat.Text;
myMail.Body = "Test";
SmtpMail.SmtpServer="smarthost";
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your password here
SmtpMail.SmtpServer = "mail.mycompany.com"; //your real server goes here
SmtpMail.Send(myMail);
解决方案 »
- 如何申请Google Maps API 密钥
- Repeat控件绑定数据,显示图片的问题!!!急急急
- 为第一张网页index.aspx指定target
- [常见问题]字符计数器是如何实现的?当向文本框中输入字符时,计数器自动减1并动态显示
- csdn到底怎么了???
- 设置了{0:c}格式为什么没有显示货币符号?
- 请问关于定位网页显示部分的问题!
- 代码引用问题?
- 服务器经常出现这样的错误(VS2005)Please hit the "Refresh" button in your web browser to retry your request.
- 网上现在有没有用ASP.NET做的实例
- 。net初级问题:我的datagrid怎么运行时无法看见呢?别的button什么的没有问题,我的是。net beta 2,谢谢先:)
- 我有一个doc文件,我想上传到oracle服务器,请问我需要做那几步工作。。。
jmail.POP3Class pm = new jmail.POP3Class();
pm.Connect(this.mail_name.Text.Trim(),this.mail_password.Text.Trim(),this.mail_pop3server.Text.Trim(),110);
jmail.Message msg = new jmail.Message();
for(int i=0;i<pm.Count;i++)
{
msg = pm.Messages[i];
//你的信件内容可以这样获得;
this.mail_sendUser.Text = msg.FromName;
this.mail_subject.Text = msg.Subject;
this.mail_receiveList.Text = msg.RecipientsString;
this.mail_body.Text = msg.Body;
break;
}
pm.Disconnect();
msg.Close();