Vectorials
Flash Perfection
3D Lessons
Tutorialkit
Markup Tutorials
Learn PHP
network
adv banner
Web Programming  Home Web Programming ASP Form Mail via CDONTS
rss

Form Mail via CDONTS

Author: Wilfried Schobeiri More by this author


Form Mail via CDONTSLearn how to send mail using the power of ASP. ASP gives you the power to send mail using the "CDONTS" mail object. This script will send an email from a user to whichever email address you choose. NOTE: if you are using Windows XP/IIS.NET, please see our tutorial regarding CDOSYS. We will ask for three things on the form to keep it simple: their name, their e-mail address, and their comments. This script will either process the email or show the form, depending on whether the "submit" button was pressed:

<%

If request("submit") <> "" THEN
Set objEMail = Server.CreateObject("CDONTS.NewMail")
objEMail.To = "your@emailaddress.com"
objEMail.From = Request("from")
objEMail.Subject = Request("subject")
objEMail.Body = Request("message")   
objEMail.Send()
Set objEMail = Nothing
Response.Write("Message Sent")
Else

%>

<form method="post" action="test.asp">
From Email: <INPUT type=text name="from"><br />
Subject: <INPUT type=text name="subject"><br />
Message: <TEXTAREA name="message" rows=10 cols=40>
</TEXTAREA><br />

<INPUT type="submit" value="Send" name="submit">
</form>

<% 
End If
%>

Not too hard eh?


Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Read/Add comments to "Form Mail via CDONTS"

comments  sabbaghi January 07, 2007 says:
Form Mail via CDONTS
I am need lern a [color=red]Form Mail via CDONTS[/color] sabaghimohammad@gmail.com