Write a program for email handling in ASP.

The code is given below:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
          <%
                   Dim mail
                   Set mail=Server.CreateObject("CDO.Message")
                   mail.To=Request.Form("to")
                   mail.From=request.Form("from")
                   mail.Subject=request.Form("subject")
                   mail.TextBody=Request.Form("body")
                   mail.Send()
                   Response.Write("Mail Sent")
                   Set mail=nothing
          %>
         
                  
    <form id="form1" name="form1" method="post" action="">
      <table width="100%" border="5" cellspacing="5" cellpadding="10">
        <tr>
          <td><label>To</label></td>
          <td><input type="text" name="to" /></td>
        </tr>
        <tr>
          <td><label>From</label></td>
          <td><input type="text" name="from" /></td>
        </tr>
        <tr>
          <td><label>Subject</label></td>
          <td><input type="text" name="subject" /></td>
        </tr>
        <tr>
          <td>Body</td>
          <td><textarea name="body"></textarea></td>
        </tr>
        <tr>
          <td><label></label></td>
          <td><label>
            <input type="submit" name="Submit" value="Submit" />
          </label></td>
        </tr>
      </table>
</form>
</body>
</html>

0 comments:

Feel free to contact the admin for any suggestions and help.