Hi, I searched that. But I am not getting for using in windows server 2003. I tried the below code:
<%
Option Explicit
dim sName, sEmail, sMessage
dim oCdoMail, oCdoConf, sConfURL
if Request.Form("Action") <> "" then
sName = Request.Form("Name")
sEmail = Request.Form("Email")
sMessage = Request.Form("Message")
Set oCdoMail = Server.CreateObject("CDO.Message")
Set oCdoConf = Server.CreateObject("CDO.Configuration")
sConfURL = "http://schemas.microsoft.com/cdo/configuration/"
with oCdoConf
.Fields.Item(sConfURL & "sendusing") = 2
.Fields.Item(sConfURL & "smtpserver") = "server name"
.Fields.Item(sConfURL & "smtpserverport") = 25
.Fields.Update
end with
with oCdoMail
.From = "you@yourdomain.com"
.To = sEmail
.Subject = "My message subject"
.TextBody = sMessage
.HTMLBody = sMessage
.Configuration = oCdoConf
.Send
end with
Set oCdoConf = Nothing
Set oCdoMail = Nothing
response.write "Thanks for your message!"
else
%>
<form method="post" action="<%=Request.ServerVariables("SCRIPT_NAME")%>">
<p>Name:<br /><input type="text" name="Name" /></p>
<p>E-mail:<br /><input type="text" name="Email" /></p>
<p>Message:<br /><textarea name="Message"></textarea></p>
<p><input type="submit" name="Action" value="Send" /></p>
</form>
<%
end if
%>
But I am not getting the mail in inbox. Any help on this.. Thank you
Thanks & Regards, Venkat
modified on Tuesday, March 9, 2010 4:33 AM