Hey ALl,
I'm new and really only know some html.
I'm trying to create a wbpage with a simple forum on it which will send mail to me with whatever the person who submitted it entered. Except I want it to submit on server side not client.
I have found this code and tryed it but doesn't seem to send. I've only uploaded it onto a geocities website, will that work?
Here's the link for the article
http://imar.spaanjaars.com/QuickDocID.aspx?QUICKDOC=249
And here's the code:
<body>
<form id="frmSendEmail" method="post" action="SendMail.asp">
Your name: <input type="text" name="txtName" id="txtName" /><br />
Your message: <textarea name="txtMessage" id="txtMessage" cols="40"
rows="10"></textarea><br />
<input type="submit" name="btnSubmit" id="btnSubmit"
value="Send Message" />
</form>
</body>
At the top of your page, right before the opening <html> tag, add this ASP code:
<%
If Request.Form("btnSubmit") <> "" Then
Dim UserName
Dim UserMessage
UserName = Request.Form("txtName")
UserMessage = Request.Form("txtMessage")
Dim Message
Message = "Mail from the Web site" & vbCrlf & vbCrLf
Message = Message & "User " & UserName & _
" left the following message: " & vbCrLf
Message = Message & UserMessage & vbCrLf & vbCrLf
Dim oMessage
Set oMessage = Server.CreateObject("CDONTS.NewMail")
Const CdoBodyFormatHTML = 0 ' Send HTML Mail
Const CdoBodyFormatText = 1 ' Send Text Mail
Const CdoMailFormatMime = 0 ' Send mail in MIME format.
Const CdoMailFormatText = 1 ' Send mail in uninterrupted
' plain text (default value).
With oMessage
.To = "
[email protected]"
.Bcc = "
[email protected]"
.From = "
[email protected]"
.Subject = "User " & UserName & " left a message"
.BodyFormat = CdoBodyFormatText ' CdoBodyFormatHTML
.MailFormat = CdoMailFormatMime ' CdoMailFormatText
.Body = Message
.Send
End with
Set oMessage = Nothing
Response.Redirect("ThankYou.asp")
End If
%>
<html>
How can I make this work. Keep in mind I'm a n00b and i really need things broken down. Also will i need something better than geocities?
I truly appreicate any help.
THanks,
Patrick