⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jmail.cs

📁 学生成绩管理系统 内有软件安装说明带论文源码齐全 结合ASP+数据库完美结合
💻 CS
字号:
//using System;


//namespace TeachHelper.Comm
//{
//    /// <summary>
//    /// Summary description for JMail
//    /// </summary>
//    public class JMail45
//    {
//        private static readonly string FILE_NAME = "JMail45.cs";

//        public static bool Send(string strSmtpServer, string strFromEmail, string strReceive
//                , string strUserName, string strPass, string strSubject, string strContent)
//        {
//            jmail.Message Jmail = new jmail.Message();

//            DateTime t = DateTime.Now;

//            //Silent属性:如果设置为true,JMail不会抛出例外错误. JMail. Send( () 会根据操作结果返回true或false
//            Jmail.Silent = true;
//            //Jmail创建的日志,前提loging属性设置为true
//            Jmail.Logging = true;
//            //字符集,缺省为"US-ASCII"
//            Jmail.Charset = "GB2312";
//            //信件的contentype. 缺省是"text/plain") : 字符串如果你以HTML格式发送邮件, 改为"text/html"即可。
//            Jmail.ContentType = "text/html";
//            //添加收件人
//            Jmail.AddRecipient(strReceive, "", "");
//            Jmail.From = strFromEmail;
//            //发件人邮件用户名
//            Jmail.MailServerUserName = strUserName;
//            //发件人邮件密码
//            Jmail.MailServerPassWord = strPass;
//            //设置邮件标题
//            Jmail.Subject = strSubject;
//            //邮件添加附件,(多附件的话,可以再加一条Jmail.AddAttachment( "c:\\test.jpg",true,null);)就可以搞定了。[注]:加了附件,讲把上面的Jmail.ContentType="text/html";删掉。否则会在邮件里出现乱码。
//            //Jmail.AddAttachment("c:\\test.jpg", true, null);
//            //邮件内容
//            Jmail.Body = strContent + "<br><br>" + t.ToString();            
//            try
//            {
//                //Jmail发送的方法
//                Jmail.Send(strSmtpServer, false);
//                Jmail.Close();
//                return true;
//            }
//            catch (Exception ex)
//            {
//                Jessup.BusinessLogicLayer.Logging.WriteError(FILE_NAME, ex.Message);
//            }

//            return false;
            
//        }

//        public static bool Send(string strReceive, string strSubject, string strContent)
//        {
//            string strSmtpServer = "smtp.126.com";
//            string strFromEmail = "yyw_84@126.com";
//            string strUserName = "yyw_84";
//            string strPass = "1238";

//            return Send(strSmtpServer, strFromEmail, strReceive, strUserName, strPass, strSubject, strContent);
//        }
//    }
//}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -