Cdonts Mail Bileşeni ile Mail Göndermek

Kodla Büyü

aakcakaza

Hiperaktif Üye
Hiperaktif
Mesajlar
4,466
arkadaslar asp de cdonts bileseni kullanarak mail gondermek icin gereken kodlar, gecen bir arkadasimiza lazim olmustu, bende merak etmistim;

<!---form sayfası kodları--->
<html>
<head>
<title>Message</title>

' Coding By Thomas Keatings
' All components of this website are subject to copyright
' For permission and advice on using this code contact admin@neonred.co.uk

<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>

<body>
<form method="POST" action="send_mail.asp">
<table width="427" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#990000">
<tr bordercolor="#CC0000" bgcolor="#990000">
<td colspan="2"><div align="center"><span class="style5 style1 style1">Contact Form </span></div></td>
</tr>
<tr bordercolor="#990000" bgcolor="#FFFFCE">
<td width="150"><div align="right"><span class="style4">Your Name:</span></div></td>
<td width="259"><input name="txtName" type="text" id="txtName" size="35"></td>
</tr>
<tr bordercolor="#990000" bgcolor="#FFFFCE">
<td><div align="right"><span class="style4">Your Email Address:</span></div></td>
<td><input name="txtEmail" type="text" id="txtEmail" size="35"></td>
</tr>
<tr bordercolor="#990000" bgcolor="#FFFFCE">
<td><div align="right"><span class="style4">Reason you are contacting me: </span></div></td>
<td><select name="lstReason" id="lstReason">
<option>Regarding this Website</option>
<option>Feedback</option>
<option>Other</option>
</select></td>
</tr>
<tr bordercolor="#990000" bgcolor="#FFFFCE">
<td><div align="right"><span class="style4">Comment:</span></div></td>
<td><textarea name="txfComments" cols="35" rows="6" id="txfComments"></textarea></td>
</tr>
<tr bordercolor="#990000" bgcolor="#FFFFCE">
<td colspan="2"><div align="center"><font face="Verdana" size="1"><br>
Please double check for spelling errors before submitting your details. <br>
<br>
<input type="submit" name="Submit" value="Submit Form">
<input type="reset" name="Submit2" value="Reset Form">
</font></div></td>
</tr>
</table>
</form>

</body>

</html>


<!---send_mail.asp kodları--->
<%@LANGUAGE="VBSCRIPT"%>
<% Option Explicit %>

<%
' Coding By Thomas Keatings
' All components of this website are subject to copyright
' For permission and advice on using this code contact admin@neonred.co.uk

DIM strName, strEmail, strReason, strComments, Mailer
strName = request.form("txtName")
strEmail =request.form("txtEmail")
strReason =request.form("lstReason")
strComments =request.form("txfComments")

Set Mailer =Server.CreateObject("CDONTS.NewMail")
Mailer.From = strEmail
Mailer.Subject ="Enter The Subject of the email here"
Mailer.To ="you@yourdomain.co.uk"
Mailer.BodyFormat=0
Mailer.MailFormat=0
Mailer.Body = "This is an email generated by your online form." &"<br>" &"<br>" & _
"<b>Name: </b>" & strName &"<br>" & _
"<b>Email Address: </b>" &strEmail &"<br>" & _
"<b>Reson For Contacting: </b>" &strReason &"<br>" & _
"<b>Comments: </b>" &strComments &"<br>"

Mailer.Send
Set Mailer = nothing
%>

<P>
<%
strName = request.form("txtName")
Response.Write strName
%>,</P>

<P>Your message has been successfully sent.</P>
 
BBNET
Geri
Üst