How to use ASP for mailbox access

Source: Internet
Author: User

 How to use ASP to implement mailbox access?

Will you see this feature on some pages when visiting the website-you can view new emails in your free mailbox while visiting the website. Is this feature very exciting and mysterious to you? Below, I will use ASP for example to show you how to implement this function.

First, you can go to some sites that provide free email services, apply for an account, and then log on. When opening your mailbox, pay attention to the content in the address bar. Now take 371 as an example, you will find that the content is usually: http://www.371.net/prog/login? User = fighter & pass = mypassword.

"Fighter" is your account and "mypassword" is your password. In this case, we can get three pieces of information from here. The first article is the url and file name of the processed file: "http: // www.371. net/prog/login "; 2nd are the variable names that record your account: user; 3rd are the variable names that record your password: pass. After we know this information, we can hand-write html files and asp files.
 

'/* The Html source file content is as follows :*/
<HTML>
<HEAD>
<Meta name = "GENERATOR" Content = "Microsoft Visual Studio 6.0">
</HEAD>
<Title> City Club homepage </title>
<Style type = "text/css">
<! --
Td {font-size: 9pt}
Body {font-size: 9pt}
Select {font-size: 9pt}
A {text-decoration: none; color: #003366; font-size: 9pt}
A: hover {text-decoration: underline; color: # FF0000; font-size: 9pt}
-->
</Style>
<Script language = "javascript">
Function check (tt ){
If (registry.doc ument. form1.selectmail. selectedIndex = 0 ){
Alert ("select your email server! ")
Specified parameter Doc ument. form1.selectmail. focus ()
Return false
}
If (tt. account. value = ""){
Alert ("the account cannot be blank! Enter. ")
Tt. account. focus ()
Return false
}
If (tt. account. value. length <3 ){
Alert ("the account length cannot be less than 3 characters! Enter. ")
Tt. account. focus ()
Return false
}
If (tt. password. value = ""){
Alert ("the password cannot be blank! Enter. ")
Tt. password. focus ()
Return false
}
If (tt. password. value. length <3 ){
Alert ("the password length cannot be less than 3 characters! Enter. ")
Tt. password. focus ()
Return false
}
Else
Return true
}
</Script>
<BODY topmargin = 12>
<Table border = 0 bgcolor = d3d3d3>
<Td>
<Form action = "PostOffice. asp" method = post Onsubmit = "return check (this)" name = form1
Target = "_ blank"> <! -- Target = "_ blank" is used here to display your mailbox in a new window -->
<Select style = "font-size: 9pt; background-color: add8e6" name = "selectmail">
<Option name = "mailsite" value = "City Club convenience Post Office" selected> City Club convenience Post Office </option>
<Option name = 'mailsite' value = '2014. net/prog/login ?; User; pass; '> 990 </option>
<Option name = 'mailsite' value = 'www .371.net/prog/login ?; User; pass; '> 371 </option>
<Option name = 'mailsite' value = 'www .188.net/prog/login ?; User; pass; '> 188 </option>
<Option name = 'mailsite' value = 'web .163.net/cgi/login ?; User; pass; '> 163 </option>
<Option name = 'mailsite' value = 'freemail .263.net/cgi/login ?; User; pass; '> 263 </option>

<Option name = 'mailsite' value = 'mail .777.net.cn/v2.0/html/mailbox.php3 ?; User; pass; '> 777 </option>
<Option name = 'mailsite' value = 'www .126.com/cgi/login ?; Email; password; '> 126 </option>
<Option name = 'mailsite' value = 'www .2911.net/cgi-bin/login ?; Username; password; '> 2911 </option>
<Option name = 'mailsite' value = 'hotmail .yn.cninfo.net/prog/login ?; User; pass; '> Yunnan 169 </option>
<Option name = 'mailsite' value = 'freemail .china.com/prog/login.pdf ?; User; pass; '> china </option>
<Option name = 'mailsite' value = 'freemail .hongkong.com/prog/login.pdf ?; User; pass; '> free email in Hong Kong </option>
<Option name = 'mailsite' value = 'freemail .netease.com/prog/login ?; User; pass; '> Netease </option>
<Option name = 'mailsite' value = 'lc3 .law5.hotmail.com/cgi-bin/dologin.pdf ?; Login; passwd; '> hotmail </option>
<Option name = 'mailsite' value = 'www .netaddress.com/tpl/door/login ?; UserID; passwd; '> use.net </option>
<Option name = 'mailsite' value = 'www .88998.com/cgi-win/login ?; Username; password; '> 88998.com</option>
<Option name = 'mailsite' value = 'www .mail.com/mailcom/login.jhtml ?; Mn; pw; '> @ mail.com </option>
</Select> <br>
Account: <input type = text name = account size = 12 style = "font-size: 9pt"> <br>
Password: <input type = password name = password size = 12 style = "font-size: 9pt"> <br>
</Td> <tr> <td align = center> <input type = submit value = "recipient" style = "font-size: 9pt">
<Input type = reset value = "Refill" style = "font-size: 9pt">
</Td>
</Form>
</Td>
</Table>
</BODY>
</HTML>
'/* Html source file content ends */

 



 

'/* The content of the PostOffice. asp Source file is as follows :*/
<% @ Language = VBScript %>
<%
Response. Buffer = true
'----------------------------------------------------
'Author: Peter. yu
'Created Date: 2000/3/13
'File Name: PostOffice. asp
'All Rights Reserved. Ownership belongs to City Club
'----------------------------------------------------
%>
<HTML>
<HEAD>
<Meta name = "GENERATOR" Content = "Microsoft Visual Studio 6.0">
</HEAD>
<Title> City Club convenience Post Office (All Rights Reserved ownership belongs to City Club) </title>
<BODY>
<%
Dim str (3)
Str1 = trim (Request. Form ("selectmail") '/* obtain the email server and user account and password information */
For I = 1 to 3'/* divide the information obtained above and assign it to the array variable */
P = instr (1, str1 ,";")
Str (I-1) = mid (str1, 1, P-1)
Str1 = mid (str1, p + 1)
Next
If instr (1, str (0), "http: //") = 0 then
WebSiteUrl = "http: //" & str (0)
Else
WebSiteURL = str (0) '/* mail server address and specified file name */
End if
Usernam = str (1) '/* account variable name */
Password = str (2) '/* password Change name */
'/* Merge characters to get such as "http://www.371.net/prog/login? User = fighter & pass = mypassword character "*/
MailUrl = webSiteUrl & usernam & "=" & trim (Request. Form ("account "))
MailUrl = mailUrl & chr (38) & password & "=" & trim (Request. Form ("password "))

Response. Redirect mailUrl '/* Open email */
%>
</BODY>
</HTML>

'/* PostOffice. asp Source File Content ends */

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.