zoukankan      html  css  js  c++  java
  • Send mail with attachment in asp.net

    //send mail
       MailMessage message = new MailMessage();
       message.To = this.txtEmail.Text.Trim();
       message.From = this.txtMyemail.Text.Trim();
       message.Body = this.txtBody.Text.Trim();
       message.Subject = this.txtTitle.Text.Trim();
       string wsFile = Server.MapPath(Request.ApplicationPath) + "\\Script\\" + site + "_" + strMM + "_WS.txt";
       MailAttachment wsAt = new MailAttachment(wsFile);
       message.Attachments.Add(wsAt);
       string strMailServer = "mail.intel.com";
       SmtpMail.SmtpServer = strMailServer;
       SmtpMail.Send(message);
       Response.Write ("<script language=javascript>alert('Your email was send out successfully.')</script>");
  • 相关阅读:
    20151019
    20151013
    20150810
    20150626
    20150625
    20150530
    HTML特殊字符大全
    label标签跳出循环
    IIS 负载均衡
    .NET代码执行效率优化
  • 原文地址:https://www.cnblogs.com/Winston/p/1026467.html
Copyright © 2011-2022 走看看