Asp.Net ʹÓÃJMail ʵÏÖÓʼþȺ·¢
Õâ¸öÐèÒªµ½ gougou ÉÏÕÒһϠJMail °²×°ÅäÖÃÒ»ÏÂ
°²×°
[¸úʹÓñð¸ö×é¼þÒ»Ñù£¬ÔÚʹÓÃJmailÓʼþ×é¼þ֮ǰҪÏÈ°²×°»ò×¢²á¸Ã×é¼þJmail.dll¡£
¾ßÌå×¢²á·½·¨£¬ÊÇÏÈ°ÑJmail.dllÎļþ¿½±´µ½Ó²Å̵ÄijһĿ¼Ï£¨ÈçC:\Jmail\Jmail.dll£©
È»ºóÖ´ÐÐÃüÁîRegsvr32 C:\Jmail\Jmail.dll¼´¿É]
ÉÏÔ´Âë
using System;
using System.Data;
using System.Configuration;
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;
/// <summary>
/// Common µÄժҪ˵Ã÷
/// </summary>
public class Common
{
#region --Ⱥ·¢Óʼþ
/// <summary>
/// ·¢ËÍÓʼþ·½·¨
/// </summary>
/// <param name="mailfromAddress">·¢¼þÈ˵ØÖ·</param>
/// <param name="mailFormPwd">·¢¼þÈËÓÊÏäÃÜÂë</param>
/// <param name="mailSMTPType">ʹÓÃÓÊÏä·þÎñÆ÷µÄSMTPµØÖ·</param>
/// <param name="topic">ÎÄÕ±êÌâ</param>
/// <param name="body">ÎÄÕÂÕýÎÄ</param>
/// <param name="mailToAddressList">ÊÕ¼þÈËÃûµ¥Áбí</param>
/// <returns></returns>
public static bool SendMailByJMail(string mailfromAddress, string mailFormPwd, string mailSMTPType, string topic, string body, System.Collections.Generic.List<string> mailToAddressList)
{
try
{
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 = "Multipart/Mixed";
Jmail.ContentType = "text/html
Ïà¹ØÎĵµ£º
±¾ÎĽéÉÜÁËASP.NET»ÃæÌøתµÄʵÏÖÒÔ¼°Æä´«ÖµÎÊÌâµÄ½â¾ö·½°¸¡£»ÃæÌøתºÍ´«ÖµÎÊÌ⣬һֱÒÔÀ´¶¼ÔÚÀ§ÈÅןոսӴ¥asp.net webÓ¦ÓóÌÐòµÄ¿ª·¢Õߣ¬Ï£Íû±¾ÎÄÄܶԳõѧÕßÃÇÓÐËù°ïÖú¡£
»ÃæÌøתºÍ´«ÖµÎÊÌ⣬һֱÒÔÀ´¶¼ÔÚÀ§ÈÅןոսӴ¥asp.net webÓ¦ÓóÌÐòµÄ¿ª·¢Õߣ¬ÏÖÂÞÁÐÌøת·½·¨ºÍ´«Öµ·½Ê½¹©´ó¼Ò²Î¿¼£»ÒòΪÎÒ±¾Éí²ÎÓëµÄÏîÄ¿¹¦Ä ......
ËäÈ»Õâ¸ö¶«Î÷ºÜ»ù±¾£¬µ«ÊÇ×Ô¼ºÓÐʱºò»¹ÊǺܻìÂÒ£¬ËùÒÔ½ñÌì¾ÍССµÄÕûÀíÁËÏ£¬Ïȸø´ó¼Ò´øÀ´µÄÊÇÒ³ÃæµÄÌøתÎÊÌâ¡£
ÒÔÏÂÊÇËÄÖÖ ´ò¿ªÐÂÒ³ÃæµÄ·½·¨.
1. Ö±½ÓתÏòÐÂÒ³Ãæ,ÔÒ³Ãæ²»±£Áô
Response.Redirect("Webform6.aspx?id=1");
2. Ö±½ÓתÏòÐÂÒ³Ãæ,ÔÒ³Ãæ²»±£Áô
nServer.Transfer("Webform6.aspx?id=1",true);
3. ´ò¿ª ......
Ç°Ò»¶Îʱ¼ä×öÁËÄ£ÄâHttpÇëÇó£¬ÄÇôÎÒÃÇÓ¦¸ÃÔõô×ö¿ÉÒÔ×èÖ¹Óû§Ä£ÄâHttpÇëÇóÁË£¬ÔÚÕâÀïÍƼöÒ»¸ö·½·¨£º¾ÍÊÇ·ÃÎÊʱ¼ä²îºÍ·ÃÎÊ´ÎÊý¡£ÎÒÃÇ°ÑÊý¾Ý·ÃÎʵÄIP´æ·Åµ½Êý¾Ý¿â£¬ÒÔ±ãÎÒÃÇÒÔºó²é¿´¡£
Ê×ÏȽ¨Á¢Êý¾Ý±íºÍ´æ´¢¹ý³Ì
CREATE TABLE [dbo].[IPAccess](
[IP] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NU ......
ASP.NET,AJAXÎļþÉÏ´«µÄÒÉÎÊ
Ô±¾ÒÔΪÓÃÕâÖÖ·½Ê½£¬°Ñ´Ë·½·¨·Åµ½Ò»¸öHttphandlerÖУ¬È»ºó´ÓJAVASCRIPT·ÃÎÊHttphandlerÀ´ÊµÏÖÎÞˢеÄÎļþÉÏ´«¡£Ã»Ïëµ½£¬ÕâÑùͬÑùÊDz»Ðеģ¬Ö»ÄÜÔÚ±¾»ú²âÊÔͨ¹ý£¬Èç¹û·Åµ½ÍøÉÏ£¬»òÕß´ÓÆäËûµØ·½·ÃÎʾͻáÌáʾÎÞ·¨ÕÒµ½Îļþ£¬¿É¼ûÔÚASP.NETÖÐËüÖ»ÄÜÓÃÓÚÉÏ´«·þÎñÆ÷¶ËµÄÎļþ¡£
֮ǰÔÚÍøÕ¾Ò²Ë ......