none
请问这里的catch(Exception)能否用e.toString的方法把报错的详细信息打印出来? RRS feed

  • 问题

  • @{ try { WebMail.SmtpServer = "smtp.qq.com"; WebMail.SmtpPort = 465; WebMail.EnableSsl = true; WebMail.UserName = "youyiyangcn"; WebMail.Password = "p@33w0rd"; WebMail.From = "rsvps@example.com"; WebMail.Send("youyiyangcn@qq.com", "RSVP Notification", Model.Name + " is " + ((Model.WillAttend ?? false) ? "" : "not") + "attending"); } catch (Exception) { @:<b>Sorry - we couldn't send the email to confirm your RSVP.</b> } }

    请问这里的catch(Exception)能否用e.toString的方法把报错的详细信息打印出来?谢谢!

    2022年10月2日 1:57