//using jmail; //using System.Net.Mail; protected bool SendMessage(string strUserId, string strEmail, string strPwd) { bool sign = false; string RecieveAddress = strEmail; //收件者Email string EmailTheme = "密码找回"; //邮件主题 string Content = "这里是邮件内容{旧密码:123456}"; Message jmailobj = new Message(); jmailobj.Logging = true; jmailobj.Silent = true; jmailobj.MailServerUserName = "service@test.com"; //发信邮件服务器的帐号 jmailobj.MailServerPassWord = "mz18rts6"; //密码 jmailobj.Subject = EmailTheme; //邮件主题 jmailobj.HTMLBody = Content; //上面定义的邮件内容 jmailobj.Charset = "gb2312"; jmailobj.From = "service@test.com"; //发送者地址 jmailobj.FromName = "我是发送者"; //发送者姓名 jmailobj.AddRecipient(RecieveAddress, RecieveAddress, "A"); //收件人地址 jmailobj.Priority = 1; if (jmailobj.Send("mail.test.com", false)) //发送邮件服务器 { sign = true; } else { sign = false; } return sign; }