private bool SendEmail(string fileName)
{
MailMessage m_Mail = new MailMessage();
m_Mail.From = new MailAddress(ConfigurationManager.AppSettings["MailFrom"]);
string m_MailToStr = ConfigurationManager.AppSettings["MailTo"];
string m_MailServer = ConfigurationManager.AppSettings["MailServer"];
string[] m_MailToList = m_MailToStr.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
for (int i = ; i < m_MailToList.Length; i++)
{
m_Mail.To.Add(new MailAddress(m_MailToList[i]));
}
m_Mail.Subject = "Pending Fund List";
m_Mail.Body = "Please find the attachment for the Pending Funds List while it is ID, OP & Perf ready. ";
m_Mail.IsBodyHtml = true;
m_Mail.BodyEncoding = System.Text.Encoding.UTF8;
Attachment m_MailAttach = null;
if (!string.IsNullOrEmpty(fileName))
{
m_MailAttach = new Attachment(fileName);
m_Mail.Attachments.Add(m_MailAttach);
}
SmtpClient client = new SmtpClient(m_MailServer);
try
{
client.Send(m_Mail);
if (m_MailAttach != null)
m_MailAttach.Dispose();
return true;
}
catch (Exception e)
{
//_log.Error(e.Message);
return false;
}
}

最新文章

  1. Linux平台 Oracle 11gR2 RAC安装Part3:DB安装
  2. 基于TXT文本的简单图书管理系统
  3. centos7 docker zookeeper
  4. php生成对象的研究
  5. UART IP和UVM的验证平台
  6. easyui combobox 中实现 checkbox
  7. 复利计算v6.0--web版--软件工程
  8. Ubuntu 14.04的vim编辑器配置Python开发环境
  9. 【nodejs】使用Node.js实现REST Client调用REST API
  10. IE7和IE8出现的计算判断问题
  11. RabbitMQ资料
  12. PHP中高级进阶之路
  13. 小程序之hover-class
  14. request.getRequestDispatcher 页面跳转,样式丢失。
  15. Exchange Online Mailbox Restoration
  16. 【转】如何基于linux进程通信设计方案
  17. luogu2607/bzoj1040 [ZJOI2008]骑士 (基环树形dp)
  18. 【BZOJ】1052: [HAOI2007]覆盖问题
  19. 力扣(LeetCode)7.整数反转
  20. UVa 10795 - A Different Task 对称, 中间状态, 数位DP 难度: 3

热门文章

  1. Connection
  2. Centos6.5搭建方法
  3. linux命令帮助 man bash
  4. apue-ubuntu环境搭建
  5. oracle建表字段包含关键字注意事项
  6. SQL Server数据库语法(一)
  7. Java基础部分 2
  8. Comet OJ Contest #15 D. 双十一特惠(困难版)
  9. 【AtCoder】AGC007
  10. ubuntu18下Docker运行springboot项目