¡@

°ê¥ß¤¤¤s¤j¾Ç

¦bWAP¤W¤§E-mail¦¬µo¹ê§@

 

 

 

°ê¥ß¤¤¤s¤j¾Ç­pºâ¾÷»Pºô¸ô¤¤¤ß

§@·~²Õ ¤ý§e¸t


¥Ø¿ý

²Ä1³¹ ²¤¶

1

   1.1 ­I´º

1

   1.2 WAP

1

   1.3 E-mail»P¨Ï¥ÎªÌ¤¶­±

2

²Ä2³¹ ¬ÛÃöªº·Ç³Æ¤u§@

3

   2.1 ³nµwÅéÀô¹Ò

3

   2.2 ¬[³]WAP¦øªA¾¹

3

   2.3 ¸ê®Æ®w

5

   2.4 SESSION

6

²Ä3³¹¡B¦¬µoE-mail

8

   3.1 ¨Ï¥ÎªÌµn¤J/µn¥X

8

   3.2 ¦¬«H

10

   3.3 µo«H

16

   3.4 ³q°T¿ý

18

²Ä4³¹¡B¨Ï¥ÎªÌ³]©w¤¶­±

19

²Ä5³¹¡Bµ²½×»P¥¼¨Óªº¤u§@

22

°Ñ¦Ò®Ñ¥Ø

23

 

 

ªþ¿ýA §¹¾ã­ì©l½X

 

ªþ¿ýB ¨Ï¥ÎªÌ»¡©ú¤â¥U

 

ªþ¿ýC ºÞ²zªÌ»¡©ú¤â¥U

 


¹Ïªí¥Ø¿ý

¹Ï1 ºô¸ô¬[ºc

3

¹Ï2 IIS¤¤ªºMIMEÃþ«¬³]©w(¤@)

4

¹Ï3 IIS¤¤ªºMIMEÃþ«¬³]©w(¤G)

5

¹Ï4 ¸ê®Æ®wµ²ºc

6

¹Ï5 Web¨Ï¥ÎªÌ³]©w¤¶­±

19

¹Ï6 ¥i¨Ñ³]©wªºªA°È

20

¹Ï7 ¡§§Úªº¶l¥ó¡¨ªº³]©wµe­±

20

¹Ï8 ³]©w¶l¥ó±b¸¹

21

 

 

ªí1 »PWML¤º®e¦³ÃöªºMIMEÃþ«¬

4


²Ä1³¹¡B²¤¶

¥»½g³ø§i»¡©ú¦p¦ó¦bWAP¤W¹ê§@¤@­Ó§¹¾ãªºE-mail¦¬µo¨t²Î¡A¨ä¤¤¥]¬AWAP¦øªA¾¹ªº¬[³]¡A§Q¥ÎPOP3¨ó©w¦¬«H¡A§Q¥ÎSMTP¨ó©w±H«H¡A¨Ï¥ÎªÌ¤¶­±³]­p¡A¥H¤Î¦øªA¾¹»P¸ê®Æ®wªººÞ²z¡C

 

1.1 ­I´º

¦æ°Ê³q°T»Pºô»Úºô¸ôªºµ²¦X¡A¨Ï±o¦æ°Ê¹q¸Ü©MPDA¤£¦A¥u¬O³æ¯Âªº³q°T¤u¨ã©M­Ó¤H¯µ®Ñ¤u¨ã¡CÂǥѻ´¥©©ö©óÄâ±aªº¯S©Ê¡AÅý¤H­Ì¥i¥HÀH®ÉÀH¦aÀò±o³Ì·s¸ê°T»P¶i¦æ¥æ©ö¡C¥Ø«eªº¦æ°Ê³q°T¤u¨ã¤´¦³¤£¤Ö­­¨î¡A¦p°O¾ÐÅé¡BCPU¡B¿Ã¹õ¤j¤p¡A¨Ï±o¦æ°Ê³q°TªºªA°È¨«¦Vµu¡B§Ö¡B·Çªº¯S©Ê¡C

 

¤é¥»NTT DoCoMo¤½¥qªºi-ModeªA°È©ó1999¦~2¤ë¤W¥«¡A¦b¤@¦~¦hªº®É¶¡¤º´N¦¨ªø¨ì¤»¦Ê¸U¤H¡C®Ú¾Ú¤é¥»³q«HÁ`©M¬ã¨s©Ò°w¹ïi-Mode¥Î¤á©Ò°µªº½Õ¬d³ø§i¡A¨Ï¥Î¹q¸Ü¡B¶l¥ó»PÂsÄýºô¯¸ªº¤ñ¨Ò¤À§O¬°39%¡B38%»P22.5%¡A¤j¬ù¬O4¡G4¡G2¡C¨Ï¥Îi-Modeªº²z¥Ñ¤¤¡A¨Ï¥ÎE-mailªº¤ñ¨Ò°ª¹F82.4%¡A¨ä¦¸¤~¬O¥´¹q¸Ü77.4%¡C¡]¹q¤l®É³ø2000/5/09¡^

 

ÁöµMi-Mode¤£¬O¨Ï¥ÎWAPªº§Þ³N¡A¦ý¬O¥i¥H±q¤¤ÁA¸Ñ¨ìµL½u¤Wºôªº¾y¤O¡A§óÁA¸Ñ¨ì¦b¦UºØÀ³¥Î¤¤¡AE-mail¬O¬Û·í­«­nªº³¡¤À¡C©ó¬O§Ú­Ì¥´ºâ¦bWAP¤W¹ê§@E-mailªº¦¬µo¡AÅý¤â¾÷»PPDA¦¨¬°¥t¤@ºØ§Î¦¡ªº·¾³q¤u¨ã¡C

 

 

1.2 WAP

WAP(Wireless Application Protocol)¥D­n¬O§â¦bºô»Úºô¸ô¤Wªº¸ê®Æ¤º®e¡A¶Ç»¼¨ì¦æ°Ê¹q¸Ü©Î¨ä¥LµL½u¸Ë¸mªº¤@ºØ¶}©ñ¦¡¼Ð·Ç¨ó©w¡C²³æ¨Ó»¡¡AWAP²¤Æ¤FInternetªº¼Ð·Ç¡A°t¦X¦æ°Ê³q°T»PµL½uºô¸ôªº¯S©Ê¡A¥HWML(Wireless Markup Language)ªº»y¨¥®æ¦¡¡A±N°T®§¶Ç»¼¨ì²¾°Ê¦¡¸Ë¸m¤W¡C

 

WAP¬O¥ÑErisson¡BNokia¡BMotorola¥H¤ÎPhone.comµ¥·~ªÌ©Ò²Õ¦¨ªºWAP forum©Ò´£¥Xªº¼Ð·Ç¡A¥i¥H»P¤j³¡¤Àªº³q°Tºô¸ô¬Û®e¡A¥]¬AGSM¡BPDC¡BCDPD¡BCDMA¡BDECTµ¥³q°T§Þ³N¡CWAPªºµ{¦¡¼Ò¦¡»PWWWªºµ{¦¡¼Ò¦¡Ãþ¦ü¡A¹ïµ{¦¡µo®i¤H­û¨Ó»¡¡A¥i¥H¥[³t¾Ç²ßªº¹Lµ{¡A¦Ó¥B³\¦h²{¦³ªº¤u¨ã³£¥i¥H¤¬¬Û¤Þ¥Î¡]¦pWeb Server¡BXML¤u¨ã¡^¡C¦ÓWAPªºÀ³¥Îµ{¦¡¤º®e®æ¦¡»PWWWªº¤º®e®æ¦¡Ãþ¦ü¡A¤º®eªº¶Ç¿é¤è¦¡¤]¬O¨Ï¥ÎWWW³q°T¨ó©wªº³¡¤À¼Ð·Ç¡C´«¨¥¤§¡A²{¦³ªºWWWÀ³¥Îµ{¦¡¥u»Ý§@¤Ö³¡¤Àªº­×§ï¡A´N¥i¥H®M¥Î¨ìWAP¤W¤F¡C

 

WAPªº¹B§@¼Ò¦¡¡A­º¥ý¥Ñ¥Î¤áºÝ´£¥X­n¨D¡A¸g¥ÑµL½uºô¸ô¶Ç¿é¨ìGateway¶i¦æ¸Ñ½X¡A¦A¶Ç°e¨ì¦³½uºô¸ô¤Wªº¦øªA¾¹¡C¦øªA¾¹³B²z­n¨D«á¡A±N¦^À³¶Ç°e¨ìGateway¡A¸ê®Æ´N³Q½s½X¶Ç¦^¥Î¤áºÝ¡C©Ò¥HGateway©Ò§êºtªº¨¤¦â¡A´N¬OµL½uºô¸ô»P¦³½uºô¸ô¤§¶¡¸ê®Æ®æ¦¡ªºÂà´«¡A¨Ï±oÀ³¥Îµ{¦¡¯à¿W¥ß©ó³q°Tºô¸ô¡C

 

1.3 E-mail»P¨Ï¥ÎªÌ¤¶­±

E-mailªºªA°È¡A¤£¥~¥G¬O¦¬«H»Pµo«H¡A¦A°t¦X³q°T¿ý»P¶l¥óºÞ²zªº¥\¯à¡A´N¥i¥Hº¡¨¬¤j³¡¤À¤Hªº¨Ï¥Î²ßºD¤F¡C¶Ç²Î³B²zE-mailªº¤è¦¡¬O¨Ï¥Î¶l¥ó³nÅé¡]¦pWindows¤WªºOutlook©ÎUNIX¤Wªºelm¡^¡A¨Ï¥ÎªÌ¥²¶·¦b¦³¦w¸Ë¯S©wµ{¦¡ªº¥D¾÷¤W¨Ï¥Î¡C¥Ø«eWWW¤W¤]¦³ºô¯¸´£¨Ñ³oÃþªºªA°È¡A¨Ï¥ÎªÌ¥u­n¦³Browser¡A´N¥i¥H³s¤WWeb Server¨Ó³B²z¹q¤l¶l¥ó¡A¤£¥ÎÂǧU¶l¥ó³nÅé¡A±N¦¬µoE-mailªº°Ê§@¥æµ¹Web Server¨Ó§¹¦¨¡C

 

µM¦ÓµL½×¿ï¾Ü­þ¤@ºØ¡A¨Ï¥ÎªÌ³£¥²¶·§ä¨ì¤@³¡¹q¸£¤Wºô¡C¦pªG­n¬ð¯}³o­Ó­­¨î¡A¦æ°Ê¹q¸Ü©MPDA´N¬O¥Ø«e³Ì¦nªº¿ï¾Ü¡C©Ò¥H§Ú­Ì­n°µªº¡A¬O§â¦bWWW¤W¤w¸gµo®i¦¨¼ôªº§Þ³N¡A°t¦XµL½uºô¸ôªº¯S©Ê¡A²¾´Ó¨ìWAP¤W¡C¨ÏE-mailªº¦¬µo¤£¨ü¯S©w³nÅé©M¦aÂIªº­­¨î¡AÀH®ÉÀH¦a³£¥i¥H±µ¨ü©M¶Ç°e¦UÃþ°T®§¡A¤j¤j¼W¥[¹q¤l¶l¥óªº¤Î®É©Ê©M¤è«K©Ê¡C

 

±µ¤U¨Ó¥²¶·¦Ò¼{²{¹ê°ÝÃD¡A¤@¯ëWAP¸Ë¸mªº¹q¤O¨Ó·½¤j¦h¬O¾a¹q¦À¨ÑÀ³¡A¦]¦¹¨Ï¥Î®É¶¡¨Ã¤£·|«Üªø¡A©Ò¥H¥²¶·¸`¬Ù¹q¤Oªº¨Ï¥Î¡A¤]´N¬OºÉ¶q´î¤Ö¸ê®Æªº¶Ç»¼¶q©M³s½u®É¶¡¡A¨Ï¥Î¸û¤jªºÀW¼e¡A´N·N¨ýµÛ¨Ï¥Îªº®É¶¡¸ûµu¡C¥t¥~¦b¨Ï¥ÎªÌªº·Pı¤W¡A·|§Q¥Î¦æ°Ê¸Ë¸m¤Wºô¤j¦h¬O¦³­¢¤Áªº»Ý­n¡A¦A¥[¤W¥¦­Ìªº¿Ã¹õ³q±`«Ü¤p¡A©Ò¥H¶Ç»¼ªº°T®§À³¸Ó­nºÉ¶q²¼ä¦Ó§Ö³t¡C

 

³o»PWWW¤WªºÀô¹Ò§¹¥þ¤£¦P¡A¦p¦ó±N­Ó¤H¹q¸£ªº¤j¿Ã¹õ·h¨ì¦æ°Ê¹q¸Ü¤W¡A¬O¨Ï¥ÎªÌ¤¶­±¤WªºÃøÃD¡C¤j¶qªº¹Ï¤ù»P¿ï³æ¶Õ¥²­n³Q±Ë±ó¡AµºÄꪺÁn¥ú®ÄªG§ó¬O»»¤£¥i¤Î¡A¥u¯à¥Î³Ì²¼äªº¤å¦r©M²³æªº¹Ï§Î¸ò¨Ï¥ÎªÌ·¾³q¡C©ó¬O³Ì«á§Ú­ÌÅý¨Ï¥ÎªÌ³]©w¤¶­±¦^¨ìWWWªº¥@¬É¡AÅý¨Ï¥ÎªÌ¥Î³Ì¤è«Kªº¤è¦¡¶i¦æ¦UºØÁcº¾ªº³]©w¡A¦Ó¤£«]­­©ó¤p«öÁä»P¤p¿Ã¹õ¤W¡C·í¥Î¦æ°Ê¸Ë¸m¨Ï¥Î§Ú­ÌªºªA°È®É¡A«h¥u¶Ç°e¤w¸g¿z¿ï¾ã²z¹Lªº¸ê®Æ¡AÅý¨Ï¥ÎªÌ¯à§Ö³t´x´¤¥L©Ò»Ý­nªº°T®§¡C


²Ä2³¹¡B¨Æ«eªº·Ç³Æ¤u§@

2.1 ³nµwÅéÀô¹Ò

³nÅ鳡¤À¡G§@·~¨t²Î±Ä¥ÎWindows 2000 Server¡A¨Ã¨Ï¥Î¨ä¤º«ØªºIIS5°µWeb  Server¡CCGI±Ä¥ÎPHP¡A¸ê®Æ®w«h¬O±Ä¥ÎMySQL¡CPHP»PMySQL­ì¥»¬O¦bLinux¤Wµo®i¡A©ó¬O¦³¸ó¥­¥x©M§K¶OªºÀuÂI¡A¦P®É¤]¤ñ¦PÃþ«¬ªºASP»PMS SQL Server©Î¬OOracle»´¥©¦h¤F¡C¥t¥~PHP¦b4.0ªºª©¥»¤§«á¤ä´©Session¡A³o¹ï§Ú­Ì¬O¤@­Ó«Ü­«­nªº¥\¯à¡C

 

µwÅ鳡¤À¡G¤@³¡­Ó¤H¹q¸£¡A¯à¦w¸ËWindows 2000 Server§Y¥i³Ó¥ô¡A¦Ó¥B·íµM­n³s±µ¤Wºô¸ô¡A¤~¯à§@¬°¦øªA¾¹¡C¥t¥~·Ç³Æ¤F30GBªºµwºÐ¡A§@¬°¸ê®Æ®wªºªÅ¶¡¡C

¸ê®Æ®w¥ÎPhpMyAdmin³o°¦Web¤¶­±ªºµ{¦¡¨ÓºÞ²z¡A¬O¥ÎPHP¼g¦¨ªºMySQLºÞ²zµ{¦¡¡A¥\¯à²³æ¦ý¤w²Å¦X§Ú­Ìªº»Ý­n¡A¦Ó¥B¦oªºWeb¤¶­±«D±`¾A¦X»·ºÝºÞ²z¡A¤]¥i¥Î¨Ó´ú¸ÕPHP»PMySQLªº³s½u¡C

 

´ú¸ÕªºÀô¹Ò¨Ï¥Î¨â­ÓWindows¤Wªº¼ÒÀÀ¾¹¡GUP Simulator»PM3Gate¡C¹ê»Ú¤W¤]¦³¨â¤ä¤â¾÷§@´ú¸Õ¥Î¡GMotorola Accompli A6188¤Ó·¥(¤º«ØPhone.comªºBrowser)¡A¥H¤ÎOKWAP i3698¡]¤º«Ø¨ä¦Û¦æ¶}µoªºBrowser¡^¡A³£¨ã¦³WAP¤Wºô»P¤¤¤åÅã¥Üªº¯à¤O¡C

 

2.2 ¬[³]WAP¦øªA¾¹

¦b¬[³]¦øªA¾¹¤§«e¡A¥ý»¡©ú¾ã­Ó¬[ºc¡Aª¾¹D§Ú­Ìªº¦øªA¾¹»Ý­n­þ¨Ç¯à¤O¡C¥Ñ¤â¾÷¨ì¶l¥ó¦øªA¾¹ªººô¸ô¬[ºc¦p¤U¹Ï©Ò¥Ü¡G

¹Ï1 ºô¸ô¬[ºc

 

¤â¾÷§Q¥ÎWAP³s±µ¨ì¹q«H·~ªÌ´£¨ÑªºGateway¡A«KÂରHTTP»P§Ú­ÌªºWAP Server·¾³q¡AServer¨Ì¾Ú¨Ï¥ÎªÌªº­n¨D¡A¦A¹ï¶l¥ó¦øªA¾¹µo¥X¦¬«H(¥ÎPOP3)©Îµo«H(¥ÎSMTP)ªº­n¨D¡A³Ì«á±Nµ²ªG¶Ç¦^¤â¾÷¡C©Ò¥HServerªº¥D­n¤u§@¡A´N¬O¯à±µ¨ü¤â¾÷¨Óªº­n¨D¡A¨Ã¥B¯à¶i¤@¨B»PMail Server·¾³q¡C

 

¥Ñ©óWAP¸g¹LGateway´NÂà´«¦¨HTTP¡A¦bºô¸ô¤Wªº¶Ç¿é¤è¦¡»P¤@¯ëªººô­¶¬Û¦P¡C©Ò¥H§Ú­Ìª½±µ¦bWeb server¤¤³]©wMIMEÃþ«¬¡A¨Ï¥¦»{ÃÑWAPªº¦UºØ®æ¦¡¡A¨Ã¥Bµ¹¤©¾A·íªº¦^À³¡A´N¥i¥H±µ¨ü¤â¾÷¨Óªº­n¨D¡AÅܦ¨WAP¦øªA¾¹¤F¡C

 

ªí1 »PWML¤º®e¦³ÃöªºMIMEÃþ«¬

¤å¥óÃþ«¬

MIME Ãþ«¬

¨å«¬ªº©µ¦ùÀɦW

²³æªºWML¤å¥ó

text/vnd.wap.wml

.wml

µL½uÂI°}¹Ï¤ù

Image/vnd.wap.wbmp

.wbmp

½sĶ¹LªºWML¤å¥ó

Application/vnd.wap.wmlc

.wmlc

WML Scripts

text/vnd.wap.wmlscript

.wmls

½sĶ¹LªºWML Scripts

Application/vnd.wap.wmlscriptc

.wmlsc

 

¥H²³æªºWML¤å¥ó¬°¨Ò¡A·í¦øªA¾¹³Q­n¨DªþÀɦW¬° .wml ªºÀɮ׮ɡA´N·|¦^À³ÀÉ®×Ãþ«¬¬°text/vnd.wap.wml¡A¨Ã¥B§i¶D¨Ï¥ÎªÌ³o¬O¤@­Ó¡¨Â²³æªºWML¤å¥ó¡¨¡C¤â¾÷¤WªºÂsÄý¾¹¦¬¨ì¥¿½Tªº¦^À³¡A´Nª¾¹D¦p¦ó±N¦¬¨ìªº¤º®eÅã¥Ü¥X¨Ó¡C[8]

 

¥H¤U¬OIISªºMIMEÃþ«¬³]©w¤è¦¡¡A°²³]¤w¸g¦bIIS¤¤¥ý³]©w¦n¤@­ÓWEB¯¸¥x¡G

 

¹Ï2 IIS¤¤ªºMIMEÃþ«¬³]©w(¤@)

 

¹Ï3 IIS¤¤ªºMIMEÃþ«¬³]©w(¤G)

 

¦Ü©óPHP»PMySQLªº¦w¸Ë»P³]©w¡A¦b¨ú±o¥¦­Ìªºwin32ª©¥»«á¡A°Ñ¦Ò¨ä¤¤ªº¦w¸Ë»¡©ú´N¥i¥H¶¶§Q¦w¸Ë¡C

 

2.3 ¸ê®Æ®w

¦b´£¨Ñ¦UºØªA°È¤§«e¡A§Ú­Ì¥²¶·¥ý½T»{¨Ï¥ÎªÌªº¨­¤À¡A¤]´N¬O­n¨D¥L­Ìµn¤J¡C³o¼Ë°µªº¦n³B¬O¤è«KºÞ²z¡A¥i¥H½T©wuserªº¨­¤À¡A¶i¦Ó´£¨Ñ¤@¨Ç­Ó¤H¤ÆªºªA°È¡A¹³¬O±`¥Îªº¶l¥ó¦øªA¾¹¡A©Î¬O³q°T¿ýµ¥µ¥¡C¦Ü©ó¤@¨Ç¤ñ¸ûÁô±Kªº¸ê®Æ¡A¹³¬O¦¨ÁZ©M¦æ¨Æ¾ä¡A«h¬O»Ý­n¥[¥H«OÅ@¡A¤£¯àÅý¨C­Ó¤H³£ÀH·N¦s¨ú¡C·íµM¤]¥i¥H¥Î¨Ó¯d¤U¤@¨Ç¬ö¿ý¡A¤£¹LIIS¤w¸g¦³logªº¥\¯à¤F¡A©Ò¥H§Ú­Ì¨Ã¥¼¹ï¦¹¦A§@¥[±j¡C

 

­±¹ï²³¦hªº±b¸¹©M¸ê®Æ¡A¶Õ¥²­n«Ø¥ß¸ê®Æ®w¨Ó¦s¨ú¡CµM¦Ó¦b«Ø¥ß¸ê®Æ®w¤§«e¡A­n¥ý³W¹º¸ê®Æ¦s©ñªº¤è¦¡¡AÀ³¸Ó­n¦³­þ¨Çtable¡A¥H¤Î¥¦­Ì¤§¶¡­n¦p¦óÃöÁp¡C³o¥²¶·­n¦Ò¼{¨ì¦s¨úªº®Ä²v¡BºÞ²z¤è«K¡B¸ê®Æ¦s©ñªº§¹¾ã©Ê¡A¦P®É³Ì¦n¯à°t¦X¨t²Îªº¯S©Ê¡C

 

§Ú­Ìªº¸ê®Æ®wµ²ºc¦p¹Ï4©Ò¥Ü¡G

 

 



¹Ï4 ¸ê®Æ®wµ²ºc

 

µn¤Jªº³¡¤À¿W¥ß¥X¨Ó¡A¦¨¬°¤@­Ó¸ê®Æ®w¡A¥u¦³¤@­Ótable±Mªù¦s©ñ©Ò¦³ªº±b¸¹©M±K½X¡C¦Ó¨C­Óuser¦³¦Û¤v±MÄݪº¸ê®Æ®w¡A¨ä¤¤¦³¤£¦Pªºtable¦s©ñ¦UºØªA°Èªº¸ê®Æ¡A¨Ò¦pmail table¦s¶l¥ó±b¸¹¡Aaddress table¦s³q°T¿ý¡C

 

·|³o¼Ë³W¹ºªº­ì¦]¡A©M¸ê®Æ®w¨t²ÎMySQL¦³«Ü¤jªºÃö«Y¡C¦]¬°MySQL±N¨C¤@­Ó¸ê®Æ®w¦s¦¨¤@­Ó¸ê®Æ§¨¡A·í§Ú­Ì«Ø¥ß¤@­Óuser Aªº¸ê®Æ®w¡AµwºÐ¸Ì´N¦h¤F¤@­Ó¥s°µuser Aªº¸ê®Æ§¨¡C¦p¦¹¤@¨Ó¡A³]©w·sªº±b¸¹«D±`¤è«K¡A¥u»Ý­n¦b±b¸¹¸ê®Æ®w¤¤¥[¤J·sªº±b¸¹±K½X¡A¦A§â¤@­Ó¹w³]±b¸¹ªº¸ê®Æ§¨½Æ»s¦¨·sªº±b¸¹¸ê®Æ§¨´N¥i¥H¤F¡C

 

µM¦Ó³o¼Ë°µªº¯ÊÂI¡A´N¬O­n·s¼W¨ä¥LªºªA°È®É¡A¥²¶·­×§ï¨C¤@­Óuserªº¸ê®Æ®w¡C¤£¹L§Ú­Ì´£¨ÑªºªA°È¤j­P©T©w¤F¡A©Ò¥H³oºØ±¡§Îµo¥Íªº¾÷·|«Ü¤Ö¡A¦Ó¥BÀ³¸Ó¦³«Ü¦h¸Ñ¨M¤èªk¡C

 

©Ò¥H·í¦³¤@­Óuserµo¥Xµn¤Jªºrequest®É¡A§Ú­Ì¥ý¤ñ¹ï±b¸¹¸ê®Æ®w¤¤ªº±b¸¹±K½X¡A¦pªG¥¿½T¡A´N¥i¥H¶}±Ò¸Ó±b¸¹ªº¸ê®Æ®w¡A¦A¨Ì¨Ï¥ÎªºªA°È¨Ó¿ï¾Ü¤£¦Pªºtable¡C¦p¦¹¤@­Óuser¦P®É¶¡¥u»Ý¶}±Ò¤@­Ó¸ê®Æ®wªº¤@­Ótable¡A¦Ó¥B¤£·|¥Î¨ì¨ä¥Lªº¸ê®Æ®w¡C©Ò¥H¹ï¨t²Îªº­t¾á«Ü¤p¡A¤]¤ñ¸û¦³®Ä²v¡C¹ïuser¦Ó¨¥¡A´N¥i¥H«Ü§Ö±o¨ì¦^À³¡A¶i¦Ó¸`¬Ù³s½uªº¶O¥Î¡C

 

2.4 SESSION

¤@­Óuserªºµn¤J¬O«ùÄò¦³®Äªº¡A¥²¶·¨Ï¥L±µ¤U¨Óªºrequest³£¾Ö¦³¸ÓuserªºÅv­­¡Aª½¨ì¥Lµn¥X¬°¤î¡C±qserverªº¨¤«×¨Ó¬Ý¡A´N¥²¶·­n¿ëÃѥثeªºrequest¬O¨Ó¦Û­þ¤@­Óuser¡C°_ªì§Ú­Ì¹Á¸Õ¥hÂ^¨ú¨Ó·½IP¡Aµ²ªG±o¨ìªº«o¸g±`¬Oproxy©ÎgatewayªºIP¡A®Ú¥»´NµL±q¤À¿ë¡Ccookie¤]¤£¾A¥Î¡A¦]¬°WAP browser¤£¤ä´©¡A§Ú­Ì¤]¤£¥i¯à¦b¤â¾÷¤W­±¶}ÀɮסC

 

³Ì«á§Ú­Ì¥Î¤Fsession¤~¸Ñ¨M³o­Ó°ÝÃD¡CSession§Q¥Îuser¶Ç°e¹L¨Óªºsession ID¨Ó©µÄòÅܼơA¨Ã¥B±N¸ê®ÆÀx¦s¦bserverºÝ¡A³o¹ïªÅ¶¡·¥¤pªº¤â¾÷¥i»¡¬O°ß¤@ªº¿ï¾Ü¡C

 

¨C·íserver¦¬¨ì¤@­ÓPHP script (.php)ªºrequest¡A´N·|©I¥sPHPªºª½Ä¶¾¹¨Ó°õ¦æ¸Óscript¡A¦A§â¿é¥X¶Ç¦^user¡C¦Ó¨C¦¸©I¥sPHP®É¡A³£·|²£¥Í¤@­Ó¿W¤@µL¤Gªºsession ID¡C¦ý¬O¦pªG¤â°Ê«ü©w¤@­Ósession ID¡A´N¥i¥H¦^´_¤@­Ósessionªºª¬ºA¡C§Ú­Ì¥i¥H±NÅܼƦs¤Jsession¤¤¡A¤§«áªºrequest¥u­n§Q¥Îsession ID¡A´N¥i¥H´£¥Xsession¤¤ªºÅܼƤF¡C

 

¹ê»Ú¤Wªº°µªk¬O¡A¦buser¿é¤J±b¸¹±K½X«á¡A¶Ç°e¨ì¤@­ÓPHP script­t³dÀˬd¡A°õ¦æ®É´N·|²£¥Í¤@­Ósession ID¡C¦pªGµn¤J¦¨¥\¡A±q¦¹³o­Ósession ID´N¸òµÛ³o­Óuser ª½¨ìµn¥X¬°¤î¤F¡C¥u­n§â³o­Ósession ID¥Îpostªº¤è¦¡ªþ¥[¦bºô­¶ªº¨C¤@­Ólink¤¤¡A¤@¥¹user¨Ï¥Î¥ô¦ó¤@­Ólink¡A³£µ¥©ó¥t¥~¶Ç°e¤F¤@­Ósession ID¨ìserverºÝ¡A§Ú­Ì´N¥i¥H¥Î¨Ó¨ú¥Xsession¤¤ªºÅܼơC¥Ñ©ó¤@­Óuser±qµn¤J¨ìµn¥X¥u¦³¤@­Ósession¡A©Ò¥H±q¥t¤@­Ó¨¤«×¨Ó¬Ý¡Asession ID¬O¤@­Ó¼È®Éªºpassword¡Auser´N¬O¾aµÛ¤@­Ósession ID¨Ó³q¦æ¦U­Óºô­¶¤§¶¡¡A«o·Pı¤£¨ì¥¦ªº¦s¦b¡C


²Ä3³¹¡B¦¬µoE-mail

3.1. ¨Ï¥ÎªÌµn¤J/µn¥X

3.1.1 Userµn¤Jµe­±

 

User¦b¦¹¿é¤J±b¸¹±K½X¡A«ö¤U ¡§Go MyWap¡¨ªº³sµ²«á¡A´N¶Ç°e¨ìserver§@Àˬd¡C

 

Server·|¥´¶}Login¸ê®Æ®w¡A¬d¸ß¦³µL¬Û²Åªº¸ê®Æ¶µ¡C

 

 

 

 

 

 

±K½XÅçÃÒªº³¡¤À­ì©l½X¦p¤U¡A¨ä¤¤¦³session»P¸ê®Æ®wªº¨Ï¥Î¡A³o¬qµ{¦¡½X¥i¥H®M¥Î¦b³\¦h¦a¤è¡G

 

   header("Content-Type¡Gtext/vnd.wap.wml");                    // °e¥XMIME type header

   include("big52uni.inc");                                                      // BIG-5ÂàUnicodeªºfunction

 

   session_start();                                                                    // ±Ò°Êsession

   if(!isset($myname))

   {

        session_register('myname');                                    // ±N¬ÛÃöªºÅܼƵù¥U¨ìsession¤¤

        $myname=$SESS_NAME;

   }

   if(!isset($mypassword))

   {

        session_register('mypassword');                                       // ±N¬ÛÃöªºÅܼƵù¥U¨ìsession¤¤

        $mypassword=$SESS_PASS;

   }

 

   $host = "localhost";

   $dbname = "login";

   $dbuser = "****";

   $dbpasswd = "****";

 

   mysql_pconnect($host, $dbuser, $dbpasswd);                 // ¶}±Ò¸ê®Æ®w¡A¬d¸ß¦³µL¬Û²Åªº¸ê®Æ¶µ

   $sqlstr = "select * from password where name='$myname'";

   $result = mysql_db_query($dbname, $sqlstr);

   $arr=mysql_fetch_array($result);

 

   if(!$arr)

          // ±b¸¹±K½X¿ù»~

   else

          // ±b¸¹±K½X¥¿½T

 

3.1.2 ³q¹L±K½XÅçÃÒ

 

¿é¤J¤F¥¿½Tªº±b¸¹±K½X«á¡A´N¦C¥X¥i¥ÎªºªA°È¨Ñuser¿ï¾Ü¡A¨Ã¥B±Nsession idÁôÂæblink¤¤¡C¦¹®ÉÆ[¹î¡¨§Úªº¶l¥ó¡¨³o­Ólinkªº­ì©l½X¬O³o¼Ëªº¡G

 

<anchor title="&#x6536;&#x767C;">&#x6211;&#x7684;&#x90F5;&#x4EF6;

 <go href="./mymail.php?SID=3e14a572451d6e7c904762a86e6ff6f6"/>

</anchor>

 

¨ä¤¤&#x6211;&#x7684;&#x90F5;&#x4EF6;´N¬O¡¨§Úªº¶l¥ó¡¨ªºUnicode®æ¦¡¡A¦ÓSID=3e14a572451d6e7c904762a86e6ff6f6¬O³o¦¸²£¥Íªºsession ID¡A·ísession±Ò°Ê¤§«á¡A©I¥sPHPªº¤º³¡¨ç¦¡session_id()´N¥i¥H±o¨ì¡C

 

 

3.1.3 µn¤J¥¢±Ñ

 

·íuser¿é¤Jªº±K½X¿ù»~®É¡AÅã¥Ü¿ù»~ªº°T®§¡A¹j¨â¬í«á¦Û°Ê¸õ¦^¿é¤Jµe­±¡C

 

¦buserµ²§ô¨Ï¥Î¤§«e¡AÀ³¸Ó­n¨Ï¥Î¡¨µn¥X¡¨ªº¿ï¶µ¡A¦¹®É´N·|±j­¢²×¤îsession¡A¥HÁקK¾D¤HÅѥΡC¤£¹L´Nºâuser¨S¦³¥¿±`µn¥X¡Asession¤]·|¦b¤@¬q®É¶¡«á¦Û°Ê¥¢®Ä¡C

 


3.2. ¦¬«H

§Ú­Ì¨Ã¨S¦³¬[³]¶l¥ó¦øªA¾¹¡A©Ò¥Huser¥²¶·¥ý´£¨Ñ¶l¥ó¦øªA¾¹ªº¸ê°T¡A¥]¬Amail serverªº¦ì§}¡A©Muser¦bmail serverªº±b¸¹±K½X¡C¦³¤F¥²¶·ªº¸ê°T«á¡A´N¥i¥H³s½u¨ìmail server¬d¬Ýuserªº«H¥ó¡A¨Ã¥B¿z¿ï³¡¤Àªº¸ê®Æ¿é¥X¨ìuserºÝ¡C

 

3.2.1 ¦C¥X¤w³]©wªº¦øªA¾¹

 

·íuser¿ï¾Ü­n¦¬µo«H®É¡A´N±q¸ê®Æ®w¤¤¨ú¥X¤w¸g³]©wªº¦øªA¾¹¡A¨Ñuser¿ï¾Ü¡C¦¹³Bµ{¦¡ªº¼gªk»P«e­z¬d¸ß±b¸¹±K½X¬Û¦ü¡A¬G¤£¦A¦C¥X­ì©l½X¡A¸Ô¨£ªþ¿ý¡C

 

 

 

 

 

 

 

3.2.2 ¦¬«H

 

User¿ï¾Ü¤@­Ó¦øªA¾¹¦¬«H¤§«á¡A´N³s½u¨ì¸Ó¦øªA¾¹¡A¬d¸ßuserªº«H¥ó¡A¦A§â«H¥ó¦CªíÅã¥Üµ¹user¬Ý¡C¦Ò¼{¨ì¤â¾÷ªº¿Ã¹õ¤j¤p¡A©Ò¥H¥uÅã¥Ü±H«H¤H©M¼ÐÃD¡C

 

¥Ñ©ó¦³¨Ç«H¥ó¬O¸g¹L½s½Xªº¡A©Ò¥H¦bÅã¥Ü¤§«e­n¥ý¥[¥H¸Ñ½X¡A¤£µM·|¬Ý¨ì¶Ã½X¡C

 

 

 

 

¦¬«H¤Î¸Ñ½Xªº³¡¤À­ì©l½X¦p¤U¡A¦]¬°PHP¦³§¹¾ãªº¶l¥ó³B²z¨ç¦¡¡A©Ò¥H§Ú­Ì¤£¥Îª½±µ»Pserver·¾³q¡G

 

$MAILSERVER= "{".$pop3[$POP3_NUM]["server"]."/pop3:110}INBOX";

$link = @imap_open($MAILSERVER, $pop3[$POP3_NUM]["name"], $pop3[$POP3_NUM]["pass"]);       // ³s½u¨ìPOP3 Server

if(!$link)

          // ³s½u¥¢±Ñ

else

    $count=imap_num_msg($link);        // ³s½u¦¨¥\, ¨ú±o«H¥óªº¼Æ¥Ø

 

if($count==0)

    // «H½c¤¤¨S¦³«H

else

{        // «H½c¤¤¦³«H

    echo "&#x4F60;&#x6709;".$count."&#x5C01;&#x4FE1;<br/>\n";   // §A¦³ n «Ê«H

    $overview = imap_fetch_overview($link, "1:".$count, 0);      // ¨ú¥X©Ò¦³ªº«H¥ó¼ÐÃD

    if(is_array($overview))

    {  

        reset($overview);

        $table=file("big5-uni.txt");

        for($i=$count-1; $i>=0; $i-=1)                    // °w¹ï¨C¤@«Ê«H, ³B²z¼ÐÃD¤¤ªº¸ê°T

        {  

            $val=$overview[$i];

            $sub=$val->subject;

            // ¥H¤U³B²z³Q½s½Xªº¼ÐÃD,

            if(strtolower(substr($sub, 0, 7))=="=?big5?")    // BASE64 encoded from BIG-5

            {

                $sub=base64_decode(substr($sub, 9, strlen($sub)-11));

                // ±NBIG-5ÂনUnicode, ¤~¯àÅã¥Ü

                $mail_subject=big52uni($sub, 16, "", $table);

            }

            else if($sub=="")

                $mail_subject="[&#x7121;&#x6A19;&#x984C;]";            //"[[µL¼ÐÃD]]";

            else if(strtolower(substr($sub, 0, 8))=="=?utf-8?") // base64 encoded from UTF-8

            {

                // ¼ÐÃD¬O¥ÎUnicode½s½X, ©Ò¥H¤£¥Î¦AÂà½X¤F

                $sub=base64_decode(substr($sub, 10, strlen($sub)-14));

                $mail_subject=substr($sub, 0, 16);

            }

            else

                $mail_subject=big52uni($sub, 16, "", $table);

 

            // ¤À¸Ñ±H«H¤H¦ì§}, ¥uÅã¥Ü¦WºÙªº³¡¤À, ¦P®É³B²z½s½X

            $from = strtok (strtok($val->from, "@"), "<>");

            if(strtolower(substr($from, 0, 7))=="=?big5?")    // BASE64 encoded from BIG-5

            {

                $from=base64_decode(substr($from, 9, strlen($from)-11));

                $mail_from=big52uni(chop($from), 14, "", $table);

            }

            else if(strtolower(substr($from, 0, 8))=="=?utf-8?") // BASE64 encoded from UTF-8

            {

                $from=base64_decode(substr($from, 10, strlen($from)-14));

                $mail_from=substr(chop($from), 0, 14);

            }

            else

                $mail_from=big52uni(chop($from), 14, "", $table);

           

            // ±o¨ì³o«Ê«HªºUID, ¬O¤@­Ó¤£­«½Æªº¥N½X, ¥Î¨Ó¦s¨ú³o«Ê«Hªº©Ò¦³¸ê®Æ

            $mail_uid=$val->uid;

 

            // Åã¥Ü±H«H¤H©M¼ÐÃD, ¨Ñuser¿ï¾Ü, ¨ä¤¤Áô§t¤Fsession ID©M«H¥óªºUID

           echo "[".$mail_from."]<anchor>$mail_subject<go href=\"viewmymail.php\">\n";

           echo "     <postfield name=\"SID\" value=\"".session_id()."\"/>\n";

           echo "     <postfield name=\"mail_num\" value=\"$mail_uid\"/>\n";

           echo "   </go>\n";

           echo "</anchor><br/>\n";

        }

    }

 

 

 


3.2.3 «H¥ó¤º®e

 

UserÂI¿ï¤@«Ê«H¥ó«á¡A´NÅã¥Ü¥X«H¥óªº¤º®e¡C

 

¹q¤l¶l¥ó¥D­n¦³¨âºØµ²ºc¡G TEXT(¯Â¤å¦r)¡A»PMULTIPART(¦h­«¤å¥ó¡A±`¥Î©óªþÀÉ¡A©Î¯S®íªº¤å¥ó®æ¦¡)¡C­Y¬OTEXT®æ¦¡¡A¦¹®É¨Ì¾Ú½s½Xªº¤è¦¡¥[¥H¸Ñ½X¡A´Nª½±µÅã¥Ü¥X¨Ó¡C¥Ø«e¥i¤ä´©ªº½s½X¦³8Bit(¥¼½s½X)¡ABASE64»PQUOTED-PRINTABLE¡A¤w¸g¥i¥H¸Ñ¥X¤j³¡¤Àªº¶l¥ó¤F¡C

 

­Y¬OMULTIPARTªº®æ¦¡¡A¦]¬°¨ü­­©ó¤â¾÷ªºÀô¹Ò¡AªþÀɩάO¹Ï¤ù³£¤£®e©öÅã¥Ü¥X¨Ó¡C©ó¬O´N¨ú¥X²Ä¤@­Ópart¡A²ßºD¤W³q±`¬OTEXTªº®æ¦¡¡C

¥H¤U¬OÅã¥Ü«H¥ó¤º®e¡A»P³B²zMULTIPART¤Î½s½Xªºµ{¦¡¤ù¬q¡A¦P®É¤]­­¨î¤F¿é¥Xªºªø«×¡G

 

// ³s½u¨ìmail server

$MAILSERVER= "{".$pop3[$POP3_NUM]["server"]."/pop3:110}INBOX";

$link=@imap_open($MAILSERVER, $pop3[$POP3_NUM]["name"], $pop3[$POP3_NUM]["pass"]);

// ¨ú±o«H¥óªº®æ¦¡¸ê°T

$stru=imap_fetchstructure ($link, $mail_num, FT_UID);

$type=$stru->type;

if($type==0)                                      //text®æ¦¡

   $encoding=$stru->encoding;

else if($type==1)                                        //multipart®æ¦¡

{

    $encoding=$stru->parts[0]->encoding;

}

else                                                     // something unsupport....¨âªÌ¬Ò«D

{   $encoding=1;

    echo big52uni("[[®æ¦¡¥¼¤ä´©]]");

}

// ¨ú±o«H¥óªº¤º®e, ¦A¨Ì¾Ú½s½X®æ¦¡¥[¥H¸Ñ½X

$message=imap_fetchbody($link, $mail_num, 1, FT_UID);

switch ($encoding)

{ 

    case 0¡G     //7BIT

            $message=$message;

            //$message="[[½s½X¥¼¤ä´©0]]\n".$message;

            break;

    case 1¡G     //8BIT

            $message=$message;

            break;

    case 2¡G     //BINARY

            //$message="[[½s½X¥¼¤ä´©2]]\n".$message;

            break;

    case 3¡G     //BASE64

            $message=base64_decode($message);

            break;

    case 4¡G     //QUOTED-PRINTABLE

            $message=imap_qprint ($message);

            break;

    case 5¡G     //OTHER

            //$message="[[½s½X¥¼ª¾]]".$message;

            break;

}

 

// §PÂ_¬O­þ¤@ºØcharset, ­Y¬Ounicode´N¤£¥ÎÂà½X

$fullheader=imap_fetchheader ($link, $mail_num, FT_UID);

$charset=stristr($fullheader, "Content-Type:");

$charset=stristr($fullheader, "charset=\"UTF-8\"");

if($charset) // ¬Outf8

    echo substr($message, 0, 600);

else // ¤£¬Outf8

    echo big52uni($message, 600, "...\n[[°T®§¹Lªø]]");

 

 

3.2.4 ¶l¥ó¿ï¶µ

 

°w¹ï¨C¤@«Ê«H¡A¥i¥H¶i¦æ¤@¨Ç°Ê§@¡A¨Ò¦p§R°£¡A¦^«H¡AÂà±Hµ¥µ¥¡A¨ä¤¤§Ú­Ì¥u¹ê§@¤F§R°£ªº°Ê§@¡C

 

 

 

 

 

 

 

 

3.2.5 ½T©w§R°£

 

·íuser¿ï¾Ü­n§R°£¶l¥ó®É¡A¥ýÅã¥Ü½T»{ªºµe­±¡A¤§«á´N¥i¥H¶i¦æ§R°£ªº°Ê§@¡C

 

Mail server¤W§R°£¶l¥ó¤À¦¨¨â­Ó¨BÆJ¡A­º¥ýmark«H¥ó¦¨deletedªºª¬ºA¡A¦¹®É«H¥ó¤´¯d¦bserver¤¤¡A¥i¥H®¾±Ï¦^¨Ó¡C¦ý§Ú­Ì§Æ±æ°¨¤W±þ±¼¶l¥ó¡A©Ò¥HÀH«á´N¤Uexpungeªº«ü¥O¡A±j­¢§R°£±¼©Ò¦³³Qmark¦¨deletedªº«H¡A¹F¦¨§Ú­Ìªº¥Øªº¡C

 

 

 

¥H¤U¬O§R°£¶l¥óªº­ì©l½X¡G

 

// ³s½u¨ìmail server

$MAILSERVER= "{".$pop3[$POP3_NUM]["server"]."/pop3:110}INBOX";

$link=@imap_open($MAILSERVER, $pop3[$POP3_NUM]["name"], $pop3[$POP3_NUM]["pass"]);

 

imap_delete($link, $mail_num, FT_UID);                   // mark as delete

imap_expunge($link);                                                     // make it really deleted

echo "&#20449;&#20214;&#24050;&#21034;&#38500;&#20102;<br/>\n";  // «H¥ó¤w§R°£¤F


3.3. µo«H

3.3.1 ±H«Hµe­±

 

·íuser¿ï¾Ü­n±H«H®É¡A´N¥X²{±H«Hªº³]©wµe­±¡C­n±H¤@«Ê«H¡A­n¨M©wªº°Ñ¼Æ¦³¡G °e«H¦øªA¾¹¡A±H«H¤H¦a§}(³q±`¬Oµ¹¦¬«H¤H¦^«H¥Îªº¦a§})¡A¦¬«H¤H¡A¼ÐÃD¥H¤Î¤º¤å¡C¨ä¤¤¦øªA¾¹©M±H«H¤H¨â¶µ¡A¥i¥H¨Æ¥ý³]©w¦n¡A¸`¬Ù¿é¤Jªº®É¶¡¡C

 

¦¬«H¤Hªº¿ï¶µ¡A¥i¥H©µ¦ù¥X³q°T¿ýªº¥\¯à¡A¦¹³¡¥÷¦b¤U¤@³¹°Q½×¡C

 

±µ¤U¨Óªº¼ÐÃD»P¤º¤å¡A¦]¬°UnicodeªºÃö«Y¡A©Ò¥H¦b¼ÒÀÀ¾¹¤W¿é¤J¤¤¤åªºµ²ªG³£¬O¶Ã½X¡A¤£¹L¦b¹ê»Úªº¤â¾÷(A6188¤Ó·¥)¤WÅã¥Ü¥¿±`¡C¥Ø«eºô¸ô¤Wªº°Q½×¡A³£»{¬°¤¤¤å¿é¤JµLªk¥¿½T¶Ç°e¡A§Ú»{¬°³o¬O¼ÒÀÀ¾¹ªºbug¡C¦]¬°¼ÒÀÀ¾¹©Ò¦bªºÀô¹Ò(Windows)¬O¨Ï¥ÎBIG-5¡A©Ò¥H¼ÒÀÀ¾¹¥²¶·§âUnicodeÂରBIG-5¤~¯à¦bµøµ¡¤¤Åã¥Ü¡A¦ý¬O¦b¼ÒÀÀ¾¹¤W¿é¤Jªº¤¤¤åÀ³¸Ó¬O¥HBIG-5ªº®æ¦¡Àx¦sªº¡AÅã¥Ü®É¼ÒÀÀ¾¹«o§â¥¦·í¦¨Unicode¶i¦æÂà½X¡Aµ²ªG¥X²{ªº¦ÛµM¬O¶Ã½X¡C¦b¤â¾÷¤W¤@«ß³£¬O¥ÎUnicode¡A©Ò¥H¨S¦³¦AÂà½Xªº°ÝÃD¡C

 

 

 

3.3.2 °e¥X¶l¥ó

 

¦pªG³]©wªº¤º®e³£¥¿½TµL»~¡A´N¥i¥H¦¨¥\°e¥X«H¥ó¡C¤Ï¤§´N§i¶D¨Ï¥ÎªÌµo¥Í¤°»ò¿ù»~¡C

 

¥Ñ©ó¤â¾÷¤W¿é¤Jªº¤¤¤å¬OUnicode®æ¦¡¡A©Ò¥H¶l¥ó¤¤ªº¤¤¤å¤]¬OUnicode¡C¦¬«H¤H¥²¶·¦³¤ä´©¤~¯à¥¿½TÅã¥Ü¡C

 

 

¥H¤U¬Oµo«Hªºµ{¦¡½X¤ù¬q¡A¨ä¤¤¨Ï¥Î¤F¤@­ÓSMTPª«¥ó¡A­t³dª½±µ»Pserver·¾³q¡A¸Ô²Óªº¤èªk¥i¥H¦bRFC821¤¤§ä¨ì¡C§Ú­Ì±N«H¥óªº¤º®e¨Ì·Óe-mailªº¼Ð·Ç®æ¦¡³]©w¨ì$mimeÅܼƤ¤¡A¦A°eµ¹SMTPª«¥ó³B²z¡C[5][10]

include "smtp_mail.inc";                   // »Pserver·¾³q¥Îªºsmtpª«¥ó

# ¨ú±o¹q¤l¶l¥óªº¸ê®Æ

$mime = "";

if (!empty($from))

   $mime .= "From¡G =?big5?B?".base64_encode($mynickname)."==?=<".$from.">\n";

if (!empty($to))

   $mime .= "To¡G $to\n";

if (!empty($subject))

   $mime .= "Subject¡G =?UTF-8?B?".$subject."==?=\n";           // ¼ÐÃD¨Ï¥ÎUTF-8½s½X

$mime .= "MIME-Version¡G 1.0\n";

$mime .= "Content-Type¡G text/plain; charset=\"UTF-8\"\n";                  // ³]©w½s½X¬°UTF-8

$mime .= "Content-Transfer-Encoding¡G base64\n\n";

$mime .= $body."\n";

  

# «Ø¥ß smtp_mail ªº¹êÅé

$smtp_sent = new smtp_mail;

 

# ±H¥X¹q¤l¶l¥ó

if( $smtp_sent->send_mail($smtp_server, $from, $to, $mime)) {

   echo big52uni("¦¨¥\°e¥X¤F!")."\n";

} else {

   echo big52uni("¶Ç°e¥¢±Ñ!")."<br/>\n";

   echo big52uni($smtp_sent->lastmsg)."\n";            // Åã¥Ü¬ÛÃöªº¿ù»~°T®§

}


3.4. ³q°T¿ý

 

3.4.1 ³q°T¿ý

 

Userµn¤J¤§«á¡A¿ï¾Ü¡¨§Úªº³q°T¿ý¡¨¡A´N¦C¥X¤w¸g«Ø¥ßªº³q°T¿ý¡C¦¹³¡¥÷¯Âºé¬O¸ê®Æ®wªº¬d¸ß¡C

 

±µ¤U¨Ó·íuser¿ï¾Ü¬Y¤@±i¦W¤ù®É¡A´NÅã¥Ü¸Ô²Óªº¸ê®Æ¡C

 

Åã¥Ü¸Ô²Óªº¸ê®Æ«á¡A¦³¤@¨Ç°Ê§@¥i¥H¹ê²{¡C­º¥ý¬Oe-mailªº³¡¤À¡AÅýuserÂI¿ï¤§«á¡A¥i¥Hª½±µµo«Hµ¹¦¹¤H¡C¦A¨Ó¬O¹q¸Üªº³¡¤À¡A¥i¥H§Q¥ÎWTAI(Wireless Telephony Application Interface)ª½±µ¼·¸¹¡C¤£¹L³o¨â³¡¤À³£ÁÙ¦b¸ÕÅ礤¡A¦]¬°³]­p³q°T¿ýªº¥Øªº¡A¥D­n¬O¥Î¨Ó°t¦X±H«H®É¡A¦¬«H¤Hªº¿ï¶µ¡C

 

 

3.4.2 ±H«H¤§¦¬«H¤H

 

¦b±H«Hªº®É­Ô¡A¿é¤J¦¬«H¤Hªº³¡¤À¥i¥H©M³q°T¿ýµ²¦X¡AÅýuser¥i¥H¿ï¾Ü¤§«e«Ø¥ß¦nªºÁpµ¸¤H¡A´î¤Ö¿é¤Jªº®É¶¡¡C

 

¦¹³¡¥÷ªºµ{¦¡³]­p¡A¥R¤Àªº§Q¥Î¤Fsessionªº¥\¯à¡C¦¬«Hªº³]©wµe­±¤¤¡A¥Rº¡¤F¦UºØ¸ê®Æ¡AUser¦b¶i¦æ³]©wªº®É­Ô¡A³o¨Ç¸ê®Æ­n¦p¦ó¶Ç»¼¬O¤@­Ó¤j°ÝÃD¡C¦ý¬O¦]¬°§Ú­Ì¨Ï¥Îsession ªº¾÷¨î¡AÅܱo«D±`®e©ö¸Ñ¨M¡C¦]¬°¤@¦¸¥u·|³]©w¤@­ÓÄæ¦ì¡A¨C¦¸user³]©w¤@­ÓÄæ¦ì¡A¥u»Ý­n¶Ç°e¨º­ÓÄæ¦ìªº¸ê®Æ©Msession ID§Y¥i¡C§Ú­Ì§â¨C¤@µ§¸ê®Æ³£¦s¤Jsession¤¤¡A¨ì®É´N¥i¥H¦bsession¤¤§ä¨ì§¹¾ãªº¸ê®Æ¤F¡C¦pªG¤£¥Îsession¡A¶Õ¥²¨C¦¸³£­n¶Ç°e©Ò¦³ªºÄæ¦ì¡A¨º´N®ö¶O¤F¤£¥²­nªºÀW¼e¡C

 


²Ä4³¹¡B¨Ï¥ÎªÌ³]©w¤¶­±

§Ú­Ì³]­p®É¦³¤@­Ó­ì«h¡A§Æ±æÅýuser¦b¨Ï¥Îªº®É­Ô¡A»Ý­n¿é¤JªºªF¦è¶V¤Ö¶V¦n¡AºÉ¶q§Q¥Î¨Æ¥ý«Ø¥ß¦nªº¸ê®Æ¡A§Q¥ÎÂI¿ïªº°Ê§@¨Ó§@¿é¤J¡C¦]¬°´N¤â¾÷¨Ó»¡¡A¿é¤J¦r¦ê¡A¤×¨ä¬O¤¤¤å¦rªº®É­Ô¡A¬O¤@¥óµh­Wªº¨Æ¡C©ó¬O§Ú­Ì¤S«Ø¥ß¤F¤@­ÓÅýuserºÞ²z¸ê®Æ¥Îªººô¯¸¡A¥Ñ©óWWWªºÀô¹Ò¤£¦A¦³¨º»ò¦hªº­­¨î¡A©Ò¥H¥i¥H¥Î¤ñ¸û¬¡¼âªº¤è¦¡ªí²{¡A¤¶­±¤]¤Íµ½³\¦h¡C

 

¦bµ{¦¡³]­p¤W¡A¤j¦h¬O¸ê®Æ®wªº¬d¸ß»P§ó·s¡A¨Ã¨S¦³¤Ó¤jªºÅܤơC

 

¹Ï5 Web¨Ï¥ÎªÌ³]©w¤¶­±

 

·íµMµn¤Jªº±b¸¹±K½X»PWAP¤W¬O¤@¼Ëªº¡A¦Ó¥Bµ{¦¡ªº³]­p¤W¤]·¥¬Û¦ü¡A©Ò®t¥u¬OÅã¥Üªº¤è¦¡¤£¦P¦Ó¤w¡C

 

 

 

 

 

µn¤J¦¨¥\¤§«á¡A´NÅã¥Ü§Ú­Ì´£¨ÑªºªA°È¡A¨ä¤¤³£¦³»Ý­n³]©wªº¸ê®Æ¡C

¹Ï6 ¥i¨Ñ³]©wªºªA°È

 

¦pªGuserÂI¿ï¡¨§Úªº¶l¥ó¡¨¡A´N±q¸ê®Æ®w¤¤¨ú¥X¶l¥óªº³]©w¡A¦C¥X¨Ó¨Ñuser½s¿è¡C

 

¹Ï7 ¡§§Úªº¶l¥ó¡¨ªº³]©wµe­±

¹Ï8¬O³]©wªºµe­±¡A¥i¥H¿é¤J¦øªA¾¹»P±b¸¹ªº¸ê°T¡C

 

¹Ï8 ³]©w¶l¥ó±b¸¹

 

¨ä¥L¦p³q°T¿ý¡A¦æ¨Æ¾äµ¥¡A³£¬O¤j¦P¤p²§¡A¬G¤£¦AÂØ­z¡C

 


²Ä5³¹¡Bµ²½×»P¥¼¨Óªº¤u§@

 

­º¥ý§Ú­Ì±NWindows IISªºWeb Server¥[¤WMIME³]©w¡A¨Ï¦o¯à±µ¨ü¥ÑWAP¨Óªº­n¨D¡A¨Ã¥B¥[¥H¾A·íªº¦^À³¡C±µ¤U¨Ó³W¹º¸ê®Æ®w¡A¥H«K¯à§Ö³tªº¦s¨ú¨Ï¥ÎªÌ±b¸¹©M¨Ï¥ÎªÌªº³]©w¸ê®Æ¡C

 

¦¬«Hªº³¡¤À¡A¥Î¨Ï¥ÎªÌ¨Æ¥ý³]©wªº¶l¥ó¦øªA¾¹»P±b¸¹¸ê®Æ¡A³z¹LPOP3ªº³q°T¨ó©w¡A¬°¨Ï¥ÎªÌ§ì¨ú¦øªA¾¹¤Wªº«H¥ó¡A¦A±N©Ò±oªº¸ê®Æ¥[¥H¿z¿ï¡AÅý¨Ï¥ÎªÌ¯à§Ö³t´x´¤¥L©Ò»Ý­nªº¸ê°T¡A©Î¬O§R°£¤£»Ý­nªº«H¥ó¡C

 

µo«Hªº³¡¤À¡A¦P¼Ë§Q¥Î¨Ï¥ÎªÌ¨Æ¥ý³]©w¦nªº¦øªA¾¹¸ê®Æ¡A¦A¥[¤W³q°T¿ýªº¥\¯à¡AºÉ¶q´î¤Ö¨Ï¥ÎªÌ¥²¶·¦b½u¤W¿é¤Jªº¸ê®Æ¡C³q°T¿ýªº¥\¯à¥D­n¬O°t¦Xµo«H®É¡A¯à§K¥h¿é¤JE-mail addressªº³Â·Ð¡A¦P®É¯à°µÂ²³æªººÞ²z¡C

 

³Ì«á§Ú­Ì¦^¨ìWWWªºÀô¹Ò¡A«Ø¥ß¤F¤@­Ó¨Ï¥ÎªÌ³]©w¤¶­±¡AÅý¨Ï¥ÎªÌ¯à«Ü¤è«Kªº³]©w¬ÛÃö¸ê°T¡A¨Ã¥B¦bWAP¤W§Ö³t¨ú¥Î¡C

 

¦Ü¦¹¡A¤@­Ó§¹¾ãªºWAP¯¸¥x¤w¸g§¹¦¨¡A¨ä¤¤ÁÙ¥]§t¤F¤@­Ó¸ê®ÆºÞ²z¤¶­±¡C¥Ø«e¤]¶}©ñ¨Ï¥Î¡A±µ¨ü±b¸¹ªº¥Ó½Ð¤F¡CµM¦Ó§Ú­Ìª¾¹D¦o¨Ã¤£¬O§¹¬üªº¡AÁÙ¦³¤@¨Ç¤è­±¥i¥H¥[±j¡C

 

1.      Network Security

ºô¸ô¬O¤£¦w¥þªº¡A¦b¶Ç»¼¦UºØ¸ê®Æ®É¡A³£¥i¯à³Q¦³¤ß¤H¤hÂ^¨ú¡A¦]¦¹²£¥Í¤£¤Öªººô¸ô¦w¥þ¾÷¨î¡A¦p SSL(Secured Sockets Layer)¡ATLS(Transaction Layer Security)¡A¥H¤ÎWAP¤WªºWTLS(Wireless Transport Layer Security)¡C¦Ó¥B¦pªG­n¹ê²{WAP¤Wªº¦w¥þ¾÷¨î¡A«h¥²¶·¦Ò¼{¨ì¤â¾÷¨ìgateway¡A¥H¤Îgateway¨ìserver¡A³o¨â¬q¤§¶¡ªº¶Ç¿é¡C

 

2.       WTAI(Wireless Telephony Application Interface)

¥Î¤â¾÷³B²z¹q¤l¶l¥ó¡A¦³¤@­Ó¨ä¥L¸Ë¸mµLªk¶W¶VªºÀu¶Õ¡A´N¬O³q¸Üªº¥\¯à¡CWAP°w¹ï³o¤@ÂI¡A¨î©w¤FWTAIªº¤¶­±¡A¯à°÷Åýuser¦b¤Wºôªº®É­Ô¡A¨Ï¥Î¤â¾÷¥»¨­ªº¥\¯à¡CÁ|¨Ò¨Ó»¡¡A·íÂsÄý¤@­Ó°Ó·~ºô¯¸®É¡A´N¥i¥Hª½±µ¥ÎÂI¿ïlinkªº¤è¦¡¼·¸¹µ¹¸Ó¤½¥q¡A§@¤fÀY¤Wªº·¾³q¡C§Ú­Ì±N¹Á¸ÕÂǦ¹°µ¥X»y­µ¶l¥ó¡A¥ÎÁn­µ¥N´À¤å¦r¡A´N¥i¥H§¹¥þ§K°£¿é¤Jªº¤£¤è«K¡A§ó¤£·|¹J¨ì½s½Xªº°ÝÃD¤F¡C


°Ñ¦Ò®Ñ¥Ø

1.¡§WAP»PWML¦æ°Ê³q°T»P¬ì§ÞÀ³¥Î¡¨, ¾G¦N®p, ¹ê®Ñ°ó¤å¤Æ, »O¥_¥«, 2000

2.¡§©ºªAWAP µL½uºô­¶»s§@¹ê°È¡¨, ±i¤l¤¯, ºX¼Ð, »O¥_¥«, 2000

3.¡§Professional WAP¡¨, Charles Arehart, Wrox Press Ltd., Birmingham UK , 2000

4.¡§³Ì·sPHP¤ÎMySQL¤Jªù»PÀ³¥Î¡¨, ºa´Ü¬ì§Þ¥Dµ§«Ç, ªQ±^, ¥x¥_¥«, 2000

5. ¡§±M·~PHPµ{¦¡³]­p¡¨, ³\»ïµ{½sĶ, ùÖ®p¸ê°T, ¥x¥_¥«, 2000

6. ¡§http://www.jerry.com.tw/¡¨, ¯«©_³Ç§Qºô

7. ¡§http://kmserv.com/¡¨, PHP/ZEND Resources Center§Þ³N»P¸ê·½¥æ¬y¤¤¤ß

8. ¡§http://www.wap1.com.tw/¡¨, WAP¶}µoªÌ¶é¦a

9. ¡§http://www.mywap.to/¡¨, MyWap

10. RFC821, Simple Mail Transfer Protocol (SMTP)

11. RFC1939, Post Office Protocol Version 3 (POP3)

12. RFC2045 , RFC2046 , RFC2047 , RFC2048 & RFC2049: Multipurpose Internet Mail Extensions (MIME).