动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 邮件系统软件 > 其它邮件服务器软件
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ 其它邮件服务器软件 ]的信息

本月文章推荐
.使用Foxmial Server构架Mail服务.
.Merak邮件服务器与它的众多可选功.
.如何用Apache James把E-mail从内.
.教你轻松组建跨区域企业邮局(图.
.C#中对POP3邮件解码.
.Windows Server 2003也能提供邮件.
.ShareMail使用手册.
.Exchange的完美替代者:MDaemon.
.新手入门:企业邮箱及邮件服务器架.
.FMS目录权限.
.邮件列表mailman在aix5.1实现.
.The Bat!快速入门.
.用PHP实现POP3邮件的收取.
.如何利用SQL Server发邮件?.
.用ASP判断Email地址是否有效.
.James -- 编写一个定制的Mailet.
.Foxmail Server 1.2 for Linux系.
.邮件客户端程序的简单开发.
.Winmail和邮件监控.
.Debian下安装Eyou Mail Server.
















......

As you see in this example I use an image for Submit Button, and another image for reset button, at the reset button I made a reload of the page (refresh) that really cleans all the fields.

At action="view.asp?fromn=seeit" I use fromn to know if view.asp is being accessed from the creation phase or from the person that wants to view the digital postcard that was sent to them. I chose to set fromn to Seeit if we are still in the creation phase, and out if we are wanting to view the postcard.

In the file makin.html all we want to do is to send the information collected in the above FORM. The fields that i'm using are the ones named above: R1, nameto, mailto, namefrom, emailfrom.

FILE: view.asp
This the the important part, here we will see if there is a person previewing the card before sending it, or a person viewing card already sent. We will take all the information sent by the POST form of the previous file.

<%
Dim fromn
Dim ident
Dim psw

' erring tells us if the card already
' exists. By default, we assum it does.
Dim erring

' I normaly use 0 and 1 for boolean,
' cause it is quicker
erring = 0


' Receiving the information
' from the link that led to this file;
' this one tell us
' what kind of access we're doing
fromn = Request.QueryString("fromn")

' here we take the ID from the post card,
' for us to know wich card we want to see.
' All this information will be compared with
' the one in the database.
ident = Request.QueryString("ident")


' This is the password
' We do not want a person that knows there exists a
' postcard with ID 13 tries to see one with ID 12.
' We will generate a random number for the password
psw = Request.QueryString("psw")

if fromn = "seeit" then
' If we just want to see the preview
' I have created sessions to keep the information,
' so that I can view the data at any step
session("postal") = Request.form("R1")
session("namefrom") = Request.form("namefrom")
session("emailfrom") = Request.form("emailfrom")

session("nameto") = Request.form("nameto")
session("emailto") = Request.form("emailto")
session("message") = Request.form("message")
else
'Someone is wanting to see an already sent card

'Open the DB connection
Set Conn = Server.CreateObject("ADODB.Connection")

' The DSN you made for the database
conn.open "DSN=postal;"

'Create a recordset
Set rs = Server.CreateObject("ADODB.Recordset")


' This is asimple SQL statement that see if the ID and
' password are connected in the DB
SQLStmt = "SELECT * FROM postal WHERE ID_POSTAL = " %26amp; _
CInt(ident) %26amp; " AND passw = " %26amp; CInt(psw)

' Execute the SQL statementz
rs.Open SQLstmt, Conn, 1, 2


if rs.EOF then
'Post card doesn't exist or invalid password!
erring = 1
else
'Postcard does exist. Populate the session
'variables with the database info.
session("postal") = rs("postal")
session("namefrom") = rs("namefrom")
session("emailfrom") = rs("emailfrom")
session("nameto") = rs("nameto")
session("emailto") = rs("emailto")
session("message") = rs("message")
'if fromn have "seeit we will show =
end if
end if
%>


marginheight="0"
marginwidth="0"
topmargin="0"
leftmargin="0"
background="images/something.gif"
bgcolor="#002400"
text="#FCC403"
>

<%
' At this time we will see if there has been an error
' We also want to make sure the form data is valid.

if erring <> 1 and (fromn="seeit" or fromn="out") and
session("postal") <> "" then

' if everything is correct we show the information
%>

使用ASPMail组件发送数字卡片

发表日期:2006-12-3 |


Sending Digital PostCards with ASP and the free component ASPEmail from Persits software.
By Joao Vieira

What is a Digital Postcard?
A digital postcard is a image a net surfer picks out, along with an accompanying personal message. The net surfer "sends" the postcard by supplying a friend's email address. A link is then emailed to the address supplied. The link takes the receiver of the digital postcard to the site which displays the image and contains the personal message.



First you must create a database to house the information for the postcards. (I use a DataBase to put the PostCards information so that when a person gets the mail with the post card only have to click on the link and the page apears, goin to DB to get the Data. So here it is the structure of my DataBase (you can make your own, with more information if you intend to.


Postal
ID_POSTAL Autonumber
passw integer
postal Text
nameto Text
namefrom Text
emailfrom Text
emailto Text
Message Text
Data Text

For the digital postcard system to work, you will need a number of images for the postcards. In my example I have six unique postcards, and 12 images for the postcards: a thumbnail and normal size image for each postcard. I also use images for buttons, the main ones being View, Send, and Repeat.

Concerning the code, I want to warn you that I am not going to be going deep into the HTML aspect; I will concentrate on the ASP. If you have any questions about this article, please contact me.

You will have to make an HTML form. I used the POST method, because I don't like to see all ofthe information submitted in the address link box. (Related Article! Passing Data Between ASP Pages)

FILE: makin.html
This file contains the form where we get all of the information from the user. This information will be used to make the digital postcard.

name="postalsent"
method="post"
action="view.asp?fromn=seeit"
target="_self"
>

.....



























......









border=0 height=51 width=110>















.jpg" hspace="5"
border="2" WIDTH="354" HEIGHT="231">

bordercolor="#000000" height="202">















From:
<%=session("namefrom")%>


Email:
<%=session("emailfrom")%>



To:
<%=session("nameto")%>



Email:
<%=session("emailto")%>




Message:


<%=session("message")%>




<%
'if fromn == "seeit" we will show the
'buttons "to send" and "to retry"
if fromn="seeit" then
%>




height="53" border="0">

%26amp;nbsp;%26amp;nbsp;%26amp;nbsp;%26amp;nbsp;%26amp;nbsp;%26amp;nbsp;%26amp;nbsp;

height="53" border="0">





<%
' Someone is viewing a card already made
' Show the reply button
else
%>





width="176">

<%
end if

' This else will only be reached if there is no card
' (i.e. the password was incorrect) We need to show
' an error message.
else
%>





border="0">




<%
end if


' This is where i remove all the postcards
' in the DB with more than 30 days old.

' I do not want to make a huge DB, so I clean
' it just to have the messages of the last 30 days.

' You can now ask.. "-So, why did you put this code here?"
' My response is:
' "- Because this is the place where you fill the DB,
' so if you are going to put another record
' at the DB, lets clean some old stuff."

' That being said, let's clean the db! :)

' Here we will get the system date (yes, the server date)
d = now()

' We will decrease 30 days at the date we have
d = DateAdd("d",-30,d)

Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "DSN=postal;"

Set rs = Server.CreateObject("ADODB.Recordset")

' Run a SQL query that will remove all out of date records
SQLStmt = "DELETE FROM postal WHERE data < #" %26amp; d %26amp; "#" '

'Run the query
rs.Open SQLstmt,Conn,1,2
%>





FILE: enviado.asp
At this time, we will validate all the information that it is supposed to sent as well as the data that we
will put in the DB. If everything is well we will send the information to the receiver by e-mail. I will
explain later how to get the free e-mail component, how to register it at the server, and how to use it.

<%

' This is the variable that I use to the ID
' of the post card
Dim identifier

' goby is anotther boolean to
' see if there is an error in the data
Dim goby

goby = 1 'lets start it with True

%>


marginheight="0"
marginwidth="0"
topmargin="0"
leftmargin="0"
background="images/something.gif"
bgcolor="#002400"
text="#FCC403"
>




<%
' Let's validate the name; the length of the
' name must be at least 2 characters long
if len(session("nameto")) < 2 then
' So if there is any problem there will be an error
goby = 0
end if


if len(session("namefrom")) < 2 then
goby = 0
end if


' Validate the e-mail, I have written
' an arthicle about this, take a look at it
If Len(session("emailfrom")) <= 5 Then
goby = 0
Else
If InStr(1, session("emailfrom"), "@", 1) < 2 Then
goby = 0
Else
If InStr(1,session("emailfrom"), ".", 1) < 4 Then
goby = 0
End If
End If
End If

If Len(session("emailto")) <= 5 Then
goby = 0
Else
If InStr(1, session("emailto"), "@", 1) < 2 Then
goby = 0
Else
If InStr(1,session("emailto"), ".", 1) < 4 Then
goby = 0
End If
End If
End If


' Make sure the message is less than 500 characters.
If len(session("message")) >= 500 Then
goby = 0
End If


' If there are errors, then let the user know
' And make him/her correct the data
if goby = 0 then %>








height="53" border="0">



<%
end if


' There are no errors. Put the data in the DB
' and send the link to the receiver via email.
If goby = 1 then
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open"DSN=postal;"

Set rs = Server.CreateObject("ADODB.Recordset")


'We need to insert a record into the database
SQLStmt = "INSERT INTO Postcard (" %26amp; _
"passw, postal, nameto, namefrom, " %26amp; _
"emailfrom, emailto, message, data) " %26amp; _
"VALUES ("

' We need a random number for our password, so
' use randomize/rnd to make a random number.
randomize()
passw = Int((9999-1)*Rnd + 1)

SQLStmt = SQLStmt %26amp; passw %26amp; ",'" %26amp; session("postal") %26amp; _
"','" %26amp; session("nameto") %26amp; "','" %26amp; _
session("namefrom") %26amp; "','" %26amp; _
session("emailfrom") %26amp; "','" %26amp; _
session("emailto") %26amp; "','" %26amp; _
session("message") %26amp; "','" %26amp; session("data") %26amp; "')"

' Write information to database
rs.Open SQLStmt, Conn


' Now you will see how to use the Free Persits
' E-Mail component

' First, Create the Mail object
Set Mail = Server.CreateObject("Persits.MailSender")

' Put the mail server you are using
Mail.Host = "mail.mailserver.com"

' Send the information of the
' person that is sending the e-mail
Mail.From = session("emailfrom")

' Who you're sending the email to.
Mail.FromName = session("namefrom")

' Put the email to send to, as well as the name of the person
Mail.AddAddress session("emailto"), session("nameto")

' Subject of the email
Mail.Subject = "Digital PostCard to " %26amp; session("nameto")

' Print the body of the email
enviar = "Let me inform you that " %26amp; session("namefrom") %26amp; _
Chr(13) %26amp; Chr(10) %26amp; _
"have sent you a digital card. To see " %26amp; _
"it follow the link :" %26amp; _
Chr(13) %26amp; Chr(10) %26amp; Chr(13) %26amp; Chr(10) %26amp; _
"http://www.???????.com/view.asp?fromn=out%26amp;" %26amp; _
"ident=" %26amp; identifier %26amp; _
"%26amp;psw=" %26amp; passw %26amp; " " %26amp; Chr(13) %26amp; Chr(10) %26amp; _
" your card is available till the day " %26amp; _
formatDateTime(d,2) %26amp; _
Chr(13) %26amp; Chr(10) %26amp; Chr(13) %26amp; Chr(10) %26amp; _
Chr(13) %26amp; Chr(10) %26amp; _
" Thanks"

Mail.Body = enviar

'Just skip if there are any errors...
On Error resume Next

' This will send the email
Mail.Send


' Display an error message if there was an error
If Err <> 0 Then %>
border="0">
<%
'Comment out this code if you want to see
'the error number
'Response.Write "

" %26amp; "Error found : " %26amp; _
Err.description %26amp; "

"

Response.Write "

SERVER SIDE ERROR, " %26amp; _
"contact site webmaster.

"

goby = 0
Else
Response.Write "


POSTCARD WAS SENT " %26amp; _
"NO PROBLEMS...
"
End if
End if

' I think that you have seen that I use the JavaScript history.back
' and go. I use it so when the user come back he don't
' loose any information already entered into the form.
%>



height="53" border="0">









Get the E-Mail free component:http://www.aspemail.com/

Let me explain how to set it up. Put the component wherever you want, I usually put the components I use
in the directory C:\Inetpub\components\. Then register it (after you put it in the directory you want) by
typing:


regsvr32 AspEmail.dll
from the command line. That's all! Remember, the email code won't work unless you register the component!
If you have any questions, please contact me:http://www.4guysfromrolla.com/webtech/joao.shtml
上一篇:免费建立自己的电子邮局 人气:3804
下一篇:企业邮件解决方案展示:Visnetic mailsever 人气:2675
浏览全部其它邮件服务器软件的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-11-22 CMS001 v2.2 bulid 081122 Beta
2008-11-22 腾讯小说小偷 v5.0 20081113
2008-11-22 iestore网上商店系统 v1.0.7.0
2008-11-22 GKEE CRM客户管理系统 v1.2
2008-11-22 shopd1网店系统 v1.3
2008-11-22 翎风个人主页管理系统 v1.5
2008-11-22 开良狗狗影视搜索小偷 v1.1
2008-11-22 XtreMedia
2008-11-22 互联网数据分享应用平台 v1.0.0
2008-11-21 傲游(Maxthon) 2.1.5 正式版
2008-11-21 Skype v3.8.0.188 Final
2008-11-21 AirPlay OpenAlpha 2008.11.20
2008-11-21 屏幕文字抓取工具 DWMouse1.3.510
2008-11-21 Vista一键还原(Vista Ghost)1.
2008-11-21 SP Photo Fix照片修改1.2破解版
2008-11-21 QQ腾讯聊天工具 v1.2正式版
2008-11-21 FlightTrack航班信息v1.0破解版
2008-11-21 RealPiano仿真钢琴1.0破解版
  发表评论
姓 名: 验证码:
内 容:
站长工具:网站收录查询 | Google PR查询 | ALEXA排名查询 | CSS在线编辑器 | 广告代码 | js/vbs加密 | md5加密 | 进制转换 | UTF-8 转换工具 | Html转换js | Html转换asp | Html转换php | Html转换perl
实用工具:汉字翻译拼音 | 拼音字典 | 符号对照表 | 个税计算 | 实时汇率查询换算 | 经典小工具 | 汉字简繁转换 | 普通单位换算 | 公制单位换算 | 生辰老黄历 | 国内电话区号 | 国家代码与域名缩写 | 文字加密解密 | 健康查询 | 万年历 | 汉字横竖排版 | 手机号码查询 | 计算器 | ip搜索
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号