日期:2014-05-18 浏览次数:20852 次
MessageClass email = new MessageClass(); email.MailServerUserName = "zj0000rd"; email.MailServerPassWord = "***"; email.From = "zj0000rd@163.com"; email.Subject = "jmail"; email.Body = "test jmail send mail"; email.AddRecipient("zj0000rd@163.com", "", ""); email.Send("mail.163.com", false);
tring FromMail = "tangsiyanking@sina.com";//发件人 string Title = "test"; //邮件主题 string Body = "test"; //邮件主体 string ShowName = "paladintsy";//显示名字 string MailUserName = "tangsiyanking"; string MailPassword = "xxxxxx";//密码就不给了.... System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(); msg.From = new MailAddress(FromMail,ShowName,System.Text.Encoding.GetEncoding("GB2312")); msg.Subject = Title;//邮件标题 msg.Body = Body;//邮件内容 msg.Priority = MailPriority.Normal;//邮件优先级 msg.SubjectEncoding = System.Text.Encoding.GetEncoding("GB2312");//标题编码 msg.BodyEncoding = System.Text.Encoding.GetEncoding("GB2312");//正文编码 msg.To.Add("seu_tangsiyan@qq.com"); System.Net.Mail.Attachment attTemp = new System.Net.Mail.Attachment("C:\\Documents and Settings\\HellKnight\\My Documents\\My Pictures\\profile.txt"); attTemp.NameEncoding = System.Text.Encoding.GetEncoding("GB2312");//附件名编码 msg.Attachments.Add(attTemp); .....................................................