“SendUsing”配置值无效。代码如下:
string fileName=Server.MapPath("email/mail1.txt");
StreamReader TxtReader = new StreamReader(fileName,Encoding.GetEncoding("gb2312"));
string text = TxtReader.ReadToEnd();
text=text.Replace("$test$",strPage);
TxtReader.Close();
MailMessage myMail=new MailMessage();
myMail.From = System.Configuration.ConfigurationSettings.AppSettings["Mailaddress"].ToStrin();
myMail.To = "某个人的邮件机地址";
myMail.Subject = System.Configuration.ConfigurationSettings.AppSettings["mailtitle"].ToString();
myMail.Priority = MailPriority.High;
myMail.BodyFormat = MailFormat.Html;
myMail.Body = text;
SmtpMail.Send(myMail);
[此贴子已经被作者于2007-7-26 14:13:17编辑过]