ASP Webpage email access

Source: Internet
Author: User

Some days ago, a friend in the group asked me how to implement the email access function on the webpage. Now, the website I saw on the Internet is loaded, and people will be there. This is html Code 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 :*/ Copy code The Code 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 :*/ Copy code The Code 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 */

Not very difficult. In fact, this is not very difficult. The key is that you can observe more and find out the rules. In this way, we can use these rules to do many interesting and meaningful things.

Related Article

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.