日期:2011-04-30  浏览次数:20808 次

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.

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

.....
    <td width="24" valign="bottom">
       <font face="Arial">
         <input type="radio" value="postal1" name ="R1">
       </font>
    </td>

    <td width="140">
       <font face="Arial">
      <IMG border=2 height=86 src="http://edu.cnzz.cn/NewsInfo/images/postal1.gif" width=134>
       </font>
    </td>

    <td width="12" valign="bottom">
       <font face=3D"Arial">                 
          <input type="radio" value="postal2" name ="R1">
       </font>
    </td>

    <td width="151">
       <font face="Arial">
          <IMG border=2 height=87 src="http://edu.cnzz.cn/NewsInfo/images/postal2.gif" width=134>
       </font>
    </td>
  </tr>

  <tr>
    <td width="24"