上传附件到Email
本机测试没问题.到了服务器上发送报404错误.我的地址写成~/Index.aspx发送完了返回主页.难道要物理路径?
//发送邮件
if (mm != null)
{
client.Send(mm);
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('发送成功!感谢您的支持')</script>");
Response.Redirect("~/Index.aspx");
}
else
{
return;
}
------解决方案--------------------------------------------------------
Response.Write("<script language=javascript>alert('发送成功!感谢您的支持');location='../Index.aspx';</script>");这样子就对了
------解决方案--------------------------------------------------------