Hello friends,
This is my first post on this forum. I am new to ASP.Net. Given below is the code that runs without error. But the receiver does not get email.
One more thing, I am confused to see that there is no need to login into the mail a/c of sender to send email. How it works actually?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<Form action="sendMail.asp" Method="post">
<table>
<tr><td width="35%">Enter Email of Recepient : </td><td><input type="Text" name="email"></td></tr>
<tr><td width="35%">Enter Message : </td><td><Textarea rows="5" cols="50" name="Message"></textarea></td></tr>
<tr><td colspan="2" align="center"> <input type="Submit" Value= "Send Mail"></td></tr>
</table>
</Form>
<%
eml=Request.Form("email")
msg=Request.Form("Message")
if Request.Form("email")<>"" then
set ObjMail=CreateObject("CDO.Message")
response.write(eml &"/br")
response.write(msg &"/br")
ObjMail.Subject="This mail is sent through ASP.net using CDOSys"
ObjMail.From="patilravindra@yahoo.com"
ObjMail.To=eml
ObjMail.TextBody=msg
ObjMail.Send
Set ObjMail=nothing
else
response.write ("Enter email.")
end if
%>
</body></html>
- Ravindra