if not Mailer.SendMail then Response.Write \" Mailing Failed... Error is: <br>\" Response.Write Mailer.Response else Response.Write \" sent successfully...<p>\" end if
function Subst (strValue, strOldValue, strNewValue) intLoc = InStr(strValue, strOldValue) While intLoc > 0 if intLoc > 1 then if intLoc = Len(strValue) then strValue = Left(strValue, intLoc-1) & strNewValue else strValue = Left(strValue, intLoc -1) & strNewValue & Right(strValue, Len(strValue)-(intLoc-Len(strOldValue)+1)) end if else strValue = strNewValue & Right(strValue, Len(strValue)-1) end if intLoc = InStr(strValue, strOldValue) Wend Subst = strValue end function
function FixUpItems (strItem) if strItem <> \"\" then strItem = Subst(strItem, \"<\", \"<\") strItem = Subst(strItem, \">\", \">\") FixUpItems = strItem else FixUpItems = \"<br>\" end if end function
\'--- Shows a form for the user to fill in host, uid and pwd --- sub ShowPopForm (strHostName, strUser, strPassword) Response.Write \"<table border=0>\" Response.Write \"<form action=\"\"AspPOP3.asp\"\" method=post>\" Response.Write \"<tr><td>Enter POP3 Mail Host:<td><input type=text size=45 name=host value=\"\"\" & strHostName & \"\"\">\" Response.Write \"<tr><td>Enter POP3 User Name:<td><input type=text size=45 name=uid value=\"\"\" & strUser & \"\"\">\" Response.Write \"<tr><td>Enter POP3 Password:<td><input type=password size=45 name=pwd value=\"\"\" & strPassword & \"\"\">\" Response.Write \"<input type=\"\"Submit\"\">\" Response.Write \"</form>\" Response.Write \"</table>\" end sub
\'--- Get the list of all message headers and display the info to the client --- sub ShowMessageList (strHost, strUid, strPwd) Response.Write \"<b>Messages Currently On Server: \" & strHost & \"</b>\" Set Mailer = Server.CreateObject(\"POP3svg.Mailer\") Mailer.RemoteHost = strHost Mailer.UserName = strUid Mailer.Password = strPwd
varArray = Mailer.MessageInfo if VarType(varArray) <> vbNull And IsEmpty(varArray) <> True then ArrayLimit = UBound(varArray) For I = 0 to ArrayLimit Response.Write \"<tr>\" strMsgNo = Trim(varArray(I)(0))
Response.Write \"<td align=left>\" & varArray(I)(7) & \"</td>\" Response.Write \"<td align=left>\" & \"<a href=AspPOP3.asp?deletemsg=\" & strMsgNo & \"&rndno=\" & intRndNo & \">Delete</a></td>\" Response.Write \"</tr>\" & Chr(10) & Chr(13) Next else Response.Write \"<tr><td colspan=10 align=center><b>No messages on server</b></tr>\" end if Response.Write \"</table><br>\" Response.Write \"<a href=\"\"AspPOP3.asp?rndno=\" & intRndNo & \"\"\">Refresh</a>\" else Response.Write \"<p>Connection Failure. Check your mailhost, username and password.\" end if Response.Write \"</blockquote>\" Set Mailer = nothing end sub
\'--- Shows the text for one specific message --- sub ShowMessage(strHost, strUid, strPwd, strMsgNo) Response.Write \"<b>Message #\" & strMsgNo & \" follows:</b>\"
Set Mailer = Server.CreateObject(\"POP3svg.Mailer\")
\'--- Make sure that you\'ve got write permissions to the following directory --- strMailBaseDir = \"e:\\webmail.wannafind.dk\\attach\" Mailer.MailDirectory = strMailBaseDir Mailer.RemoteHost = strHost Mailer.UserName = strUid Mailer.Password = strPwd Mailer.OpenPop3
\'--- Log option for debug --- \'Mailer.Pop3Log = \"\"&strMailBaseDir&\"pop3log.txt\"
if Mailer.AttachmentCount > 0 then Response.Write \"<table border=1>\" & VbCrLf Response.Write \"<tr><td>Attachment</td><td>ContentType</td><td>FileName</td><td>FileSize</td></tr>\" & VbCrLf For intCount = 1 to Mailer.AttachmentCount if Mailer.GetAttachmentInfo (intCount) then Response.Write \"<tr><td>\" & intCount & \"</td><td>\" & Mailer.AttContentType & \"</td><td><a href=\"\"\" & Mailer.AttFileName & \"\"\">\" & Mailer.AttFileName & \"</a></td><td>\" & Mailer.AttFileSize & \"</td></tr>\" & VbCrLf Mailer.SaveAttachment (intCount) end if Next Response.Write \"</table>\" & VbCrLf end if Response.Write \"<br><a href=\"\"AspPOP3.asp?rndno=\"&Second(Now)&\"\"\">Back</a>\" & VbCrLf Set Mailer = nothing end sub
\'--- DELETE the message PERMANENTLY from the server --- sub DeleteMessage (strHost, strUid, strPwd, strMsgNo) Response.Write \"<b>Deleting Message #\" & strMsgNo & \" From Server</b><p>\" Set Mailer = Server.CreateObject(\"POP3svg.Mailer\")
if (strUid = \"\") or (strPwd = \"\") or (strHost = \"\") then ShowPopForm strHost, strUid, strPwd else if (strMsgNo <> \"\") then ShowMessage strHost, strUid, strPwd, strMsgNo else if (strDeleteNo <> \"\") then DeleteMessage strHost, strUid, strPwd, strDeleteNo else ShowMessageList strHost, strUid, strPwd end if end if end if
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.