C#代码
public static bool PostMail(string PostTOMail, string MailTitle, string Pwd)
{
string SmtpMailUser = "[email protected]"; //发件箱帐户
string SmtpMailPWD = "111111"; //该帐户对应的密码
string SmtpMailHost = "mail.kehonsoft.com"; //邮件服务器
string SBody = "<html><body><h1>您收到的邮件来自随风起舞!<a href='http://intels.net'></a></h1></body></html>";
MailMessage MSG = new MailMessage();
MSG.From = new MailAddress(SmtpMailUser);
MSG.To.Add(PostTOMail);
MSG.Subject = MailTitle;
MSG.IsBodyHtml = true;
MSG.Body = SBody; SmtpClient sc = new SmtpClient();
//sc.EnableSsl = true; //是否SSL加密
sc.Host = SmtpMailHost; //邮件服务器
sc.Port = 25; //smtp端口
sc.Credentials = new NetworkCredential(SmtpMailUser, SmtpMailPWD);
//邮件发送报告
try
{
sc.Send(MSG);
return true;
}
catch
{
return false; } }
为什么邮件里没有http://intels.net这个链接呢....
MailMessage MSG = new MailMessage();
string SBody = " <html> <body> <h1>您收到的邮件来自随风起舞! <a href='http://intels.net?id = ' +posttomail > http://intels.net?id = '+ posttomail </a> </h1> </body> </html>";
MailMessage MSG = new MailMessage();
MailMessage MSG = new MailMessage(); <A>这里相当于 说明 真正的连接地址是写在<a href=>所以你要传递参数 当然是写在HREF的连接地址后面了!</A>