メール受信


  model.inc




メールデータ受信用として、前もってプログラムディレクトリに MailData と MailTemp を作成します

  

<%
' **********************************************************
' 件数取得
' **********************************************************
Function GetMailCount( )

	Dim Basp,Result,aWork

	Set Basp = Server.CreateObject( "Basp21" )

	Result = Basp.RcvMail( _
		POP3Server, _
		UserName, _
		UserPassword, _
		"STAT" , _
		">" & Server.MapPath( "MailData" ) _
	)

	if IsArray( Result ) then
		aWork = Split( Result( 0 ), " " )
		Message = "メールは " & aWork( 0 ) & " 件受信可能です"
	else
		ErrMessage = "メール処理のエラーです : "
		ErrMessage = ErrMessage & Result
	end if

	Set Basp = Nothing

End Function

' **********************************************************
' ヘッダー情報の一覧
' **********************************************************
Function GetMailList( )

	Dim Basp,Result

	Set Basp = Server.CreateObject( "Basp21" )

	Result = Basp.RcvMail( _
		POP3Server, _
		UserName, _
		UserPassword, _
		"LIST" , _
		">" & Server.MapPath( "MailData" ) _
	)

	Set Basp = Nothing

	if IsArray( Result ) then
		For I = 0 to Ubound( Result )
			Call EditMailData( Result( i ) )
		Next
	else
		ErrMessage = "メール処理のエラーです : "
		ErrMessage = ErrMessage & Result
	end if

End Function

' **********************************************************
' ヘッダー情報の一覧の編集
' **********************************************************
Function EditMailData( RowData )

	Dim aMail

	aMail = Split( RowData, vbTab )

	OutData = OutData & "<TR>"

	OutData = OutData & "<TD class=MyCell>"
	strWork = Replace( aMail( 1 ), "From: ", "" )
	strWork = Server.HTMLEncode( strWork )
	OutData = OutData & strWork
	OutData = OutData & "</TD>"

	OutData = OutData & "<TD class=MyCell>"
	OutData = OutData &  Replace( aMail( 0 ), "Subject: ", "" )
	OutData = OutData & "</TD>"

	OutData = OutData & "<TD class=MyCell>"
	OutData = OutData &  Replace( aMail( 2 ), "Date: ", "" )
	OutData = OutData & "</TD>"

	OutData = OutData & "</TR>"

End Function

' **********************************************************
' メールデータの受信と一覧
' **********************************************************
Function GetMailList2( )

	Dim Basp,Result,I

	Set Basp = Server.CreateObject( "Basp21" )

	Result = Basp.RcvMail( _
		POP3Server, _
		UserName, _
		UserPassword, _
		"SAVE 1-10" , _
		">" & Server.MapPath( "MailData" ) _
	)

	if IsArray( Result ) then
		For I = 0 to Ubound( Result )
			Call EditMailData2( Basp, Result( i ) )
		Next
	else
		ErrMessage = "メール処理のエラーです : "
		ErrMessage = ErrMessage & Result
	end if

	Set Basp = Nothing

End Function

' **********************************************************
' メールデータの受信と一覧の編集
' **********************************************************
Function EditMailData2( Basp, RowFile )

	Dim Result,I

	Result = Basp.ReadMail( _
		RowFile, _
		"", _
		Server.MapPath( "MailTemp" ) _
	)

	if not IsArray( Result ) then
		OutData = OutData & "<TR>"
		OutData = OutData & "<TD class=MyCell colspan=3>"
		OutData = OutData &  "読込エラー : " & Result
		OutData = OutData & "</TD>"
		OutData = OutData & "</TR>"
		Exit Function
	end if

	OutData = OutData & "<TR>"
	For I = 0 to Ubound( Result )
	   if Left( Result(I), 5 ) = "From:" then
	      OutData = OutData & "<TD class=MyCell>"
	      OutData = OutData & "<A href=""control.asp?In2Command=ReadMail&target="
	      OutData = OutData & Server.UrlEncode(RowFile)
	      OutData = OutData & "&GNO=" & PASS_LIST & """>"
	      strWork = Replace( Result(I), "From: ", "" )
	      strWork = Server.HTMLEncode( strWork )
	      OutData = OutData & strWork
	      OutData = OutData & "</A>"
	      OutData = OutData & "</TD>"
	   end if
	Next
	For I = 0 to Ubound( Result )
		if Left( Result(I), 8 ) = "Subject:" then
			OutData = OutData & "<TD class=MyCell>"
			OutData = OutData &  Replace( Result(I), "Subject: ", "" )
			OutData = OutData & "</TD>"
		end if
	Next
	For I = 0 to Ubound( Result )
		if Left( Result(I), 5 ) = "Date:" then
			OutData = OutData & "<TD class=MyCell>"
			OutData = OutData &  Replace( Result(I), "Date: ", "" )
			OutData = OutData & "</TD>"
		end if
	Next
	OutData = OutData & "</TR>"

End Function

' **********************************************************
' メール本文の表示
' **********************************************************
Function ReadMail( )

	Dim Basp,Result,I,strWork

	Set Basp = Server.CreateObject( "Basp21" )

	Result = Basp.ReadMail( _
		MyData( "target" ), _
		"", _
		Server.MapPath( "MailTemp" ) _
	)

	if not IsArray( Result ) then
		OutData = OutData & "<TR>"
		OutData = OutData & "<TD class=MyCell colspan=3>"
		OutData = OutData &  "読込エラー : " & Result
		OutData = OutData & "</TD>"
		OutData = OutData & "</TR>"
		Exit Function
	end if

	OutData = OutData & "<TR>"
	For I = 0 to Ubound( Result )
		if Left( Result(I), 5 ) = "From:" then
			OutData = OutData & "<TD class=MyCell><B>"
			strWork = Replace( Result(I), "From: ", "" )
			strWork = Server.HTMLEncode( strWork )
			OutData = OutData & strWork
		end if
	Next
	For I = 0 to Ubound( Result )
		if Left( Result(I), 12 ) = "Return-Path:" then
			OutData = OutData &  "</B><BR>"
			OutData = OutData &  Replace( Result(I), "Return-Path: ", "" )
			OutData = OutData & "</B></TD>"
		end if
	Next
	For I = 0 to Ubound( Result )
		if Left( Result(I), 8 ) = "Subject:" then
			OutData = OutData & "<TD class=MyCell><B>"
			OutData = OutData &  Replace( Result(I), "Subject: ", "" )
			OutData = OutData & "</B></TD>"
		end if
	Next
	For I = 0 to Ubound( Result )
		if Left( Result(I), 5 ) = "Date:" then
			OutData = OutData & "<TD class=MyCell>"
			OutData = OutData &  Replace( Result(I), "Date: ", "" )
			OutData = OutData & "</TD>"
		end if
	Next
	For I = 0 to Ubound( Result )
		if Left( Result(I), 5 ) = "Body:" then
			OutData = OutData & "</TR>"
			OutData = OutData & "<TR>"
			OutData = OutData & "<TD class=MyCell colspan=3>"
			strWork = Replace( Result(I), "Body: ", "" )
			strWork = Server.HTMLEncode( strWork )
			strWork = Replace( strWork, vbCrLf, "<BR>" )
			OutData = OutData &  strWork
			OutData = OutData & "</TR>"
		end if
	Next

	Set Basp = Nothing

End Function

' **********************************************************
' VIEW の編集
' **********************************************************
Function EditDataHead( )


End Function

' **********************************************************
' VIEW2 の編集
' **********************************************************
Function EditDataBody( )


End Function

%>
  










yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  辞書  天気 


[webclass]
CCBot/2.0 (https://commoncrawl.org/faq/)
25/01/22 12:45:21
InfoBoard Version 1.00 : Language=Perl

1 BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube