while posting comments on the site, the mail should generate and automatically send to administrator
how to do automatic mail generation in asp
Collapse
X
-
Tags: None
-
Hello sandipingle,
Here is a one page example that you can use/tweak.
Hope this helps~
ThisPage.asp
[code=asp]
<%
If (Request.Form(" xSendMessage")) Then
Set myMail=CreateOb ject("CDO.Messa ge")
myMail.Subject = Request.Form("x Subject")
myMail.From = "Billy@billy.co m" 'Place an email address here so when someone replies to this email you will get it.
myMail.To = Request.Form("x Email")
myMail.TextBody = Request.Form("x Message")
On Error Resume Next
myMail.Send
If Err <> 0 Then
Response.Write( "<h3><Font Color='#FF0000' >Error occurred: <i>" & Err.Description & "</i></Font></h3>")
else
Response.Write( "Your message was sent successfully.")
End If
End If
%>
<html>
<head>
<title>Exampl e</title>
</head>
<body>
<form method="post" action="ThisPag e.asp" name="xForm" id="xForm">
<input type="hidden" name="xSendMess age" value="true">
Full Name: <input type="text" name="xName" size="50"><br>
Email: <input type="text" name="xEmail" size="50"><br>
Subject: <input type="text" name="xSubject" size="50"><br>
Message: <textarea name="xMessage" cols="50" rows="5"></textarea><br>
<input type="submit" value="submit">
</form>
</body>
</html>
[/code]Comment
Comment