using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class mailTest : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string bodystr = ""; bodystr = "Ò»·â²âÊÔÓʼþ"; jmail.Message jmail = new jmail.Message(); //DateTime t = DateTime.Now; string subject = "Ò»·â²âÊÔÓʼþ"; string fromemail = "12345@qq.com"; string toEmail = "ysclc@163.com"; //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(toEmail, "", ""); jmail.From = fromemail; //·¢¼þÈËÓʼþÓû§Ãû jmail.MailServerUserName = "12345"; //·¢¼þÈËÓʼþÃÜÂë jmail.MailServerPassWord = "password";//qqºÅÃÜÂë //ÉèÖÃÓʼþ±êÌâ jmail.Subject = subject; //ÓʼþÌí¼Ó¸½¼þ,(¶à¸½¼þµÄ»°£¬¿ÉÒÔÔÙ¼ÓÒ»Ìõjmail.addattachment( "c:\\test.jpg",true,null);)¾Í¿ÉÒԸ㶨ÁË¡££Û×¢£Ý£º¼ÓÁ˸½¼þ£¬½²°ÑÉÏÃæµÄjmail.contenttype="text/html";ɾµô¡£·ñÔò»áÔÚÓʼþÀï³öÏÖÂÒÂë¡£ //jmail.addattachment( "c:\\test.jpg",true,null); //ÓʼþÄÚÈÝ jmail.Body = bodystr; //jmail·¢Ë͵ķ½·¨ if (jmail.Send("smtp.qq.com", false)) { Response.Write("ok"); } else { Response.Write("no"); } jmail.Close(); } }
ÉÏÊö´úÂëÊÇ°¸Àý
¾ßÌå²Ù×÷²½Öè
- ÏÂÔØjmail.dll( µã»÷ÏÂÔØ)
- ±¾µØ×¢²ájmail×é¼þ£¨°Ñjmail.dll·ÅÈëϵͳÅÌÏÂsystem32Îļþ¼ÐÏ£¬ÔËÐÐcmd ÊäÈë regsvr32 jmail.dll £©
- vsÔö¼Ó¶Ôjmail.dllµÄÒýÓÃ
- ÔËÐÐÉÏÊö´úÂë²âÊÔ¼´¿É£¬ÉÏÃæÊÇ×î¼òµ¥¶¼Ó¦Ó㬿ÉÒÔ¸ù¾Ý×Ô¼ºµÄÐèÇóдһ×Ô¼ºµÄÀà¡£
ÍƼöÐÅÏ¢
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- Asp.net MVCÔ´Âë·ÖÎö--Model Validation(Se....
- .Net À¬»ø»ØÊÕ»úÖÆÔÀíºÍËã·¨£¨Ò»£©
- .netʵÌåнâ
- ·ÖÎöASP.NET¶ÁÈ¡XMLÎļþ4ÖÖ·½·¨
- »ñÈ¡ÍøÕ¾ËõÂÔͼ´úÂë
- Asp.net ¸ù¾ÝIPµØÖ·»ñÈ¡¿çÍø¶ÎmacµØÖ·º¯Êý¡¾ËѲء¿
- ¹ýÂËÃô¸Ð¹Ø¼ü×Ö¡£
- Éú³ÉÖ¸¶¨Î»ÊýµÄËæ»ú×Ö·û´®
- ¿Í»§¶Ë»ñÈ¡MACµØÖ·£¬µ½·þÎñÆ÷ÑéÖ¤
- ²½²½ÎªÓª .NETÈý²ã¼Ü¹¹½âÎö ¶þ¡¢Êý¾Ý¿âÉè¼Æ
ÆÀÂÛ