delegate void MyDelegate();
protected void ibtnGet_Click(object sender, ImageClickEventArgs e)
{
//MyDelegate myDelegate = new MyDelegate(SentMail);
//myDelegate.BeginInvoke(null, null);
SentMail();
Page.RegisterStartupScript("div_script", "<script>alert('提交成功!')</script>");
txtEmail.Text = "";
}
private void SentMail()
{
Mail mail = new Mail();
string content = @"";
mail.SendSMTPEMail("easthome.com", "marketing@××××××", "××××××", txtEmail.Text, "首页提交成功", content, Server.MapPath("/").TrimEnd('/') + "/Upload/mail/东方瑞通-课程简介.rar");
}
上面是直接调用的sentmail发邮件一点问题都没有
delegate void MyDelegate();
protected void ibtnGet_Click(object sender, ImageClickEventArgs e)
{
MyDelegate myDelegate = new MyDelegate(SentMail);
myDelegate.BeginInvoke(null, null);
Page.RegisterStartupScript("div_script", "<script>alert('提交成功!')</script>");
txtEmail.Text = "";
}
private void SentMail()
{
Mail mail = new Mail();
string content = @"";
mail.SendSMTPEMail("easthome.com", "marketing@××××××", "×××××", txtEmail.Text, "首页提交成功", content, Server.MapPath("/").TrimEnd('/') + "/Upload/mail/东方瑞通-课程简介.rar");
}
关注,帮顶
我觉得似乎不像是代码上的问题,你还是主要查查环境配置的问题,比如说网络,邮箱等方面
最好调试看看,这说明不了问题在哪