0

I want to send mail from an asp page. The asp page is called from a html page. The sending mail using CDOSYS and CDO is not working properly. When i call the asp page from html page, the script for sending mail in the asp page is getting displayed while running rather than working of the process which i had mentioned in the script to work.

The attached image file "sendmail.JPG" shows the runtime problem, when the asp file is being called from html file.


HTML Code

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

</head>

<body>

<form action=sendmail.asp method="POST">
  <p><input type="text" name="T1" size="20"></p>
  <p><input type="submit" value="Submit" name="B1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="reset" value="Reset" name="B2"></p>
</form>

</body>

</html>

ASP File "sendmail.asp" code
*****************************

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<%

function sendmail()
{

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="rksvidhya@yahoo.com"
myMail.To="swornavidhya.mahadevan@gmail.com"
myMail.TextBody="This is a message."

        myMail.Configuration.Fields.Item _
		("http://schemas.microsoft.com/cdo/configuration/smtsperver") = "smtp.gmail.com";
       myMail.Configuration.Fields.Item _
       ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465;
       myMail.Configuration.Fields.Item _
       ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;
       myMail.Configuration.Fields.Item _
       ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")= 1;
       myMail.Configuration.Fields.Item _
       ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = "true";  
       myMail.Configuration.Fields.Item _
       ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "swornavidhya.mahadevan@gmail.com";
       myMail.Configuration.Fields.Item _
       ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "************"; // My gmail password.
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing

response.write("<script>alert('Process Successful.')</script>");

}
%>
</head>

<body>

</body>

</html>

Kindly help me at the earliest.

M.Sworna Vidhya

Attachments sendmail.JPG 98.14 KB
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by pritaeas
0

According to your image, you link to the local file. Apparantly, your local webserver does not recognize the asp extension. So instead of executing the code it thinks it is html. Check your webserver configuration.

Edited by pritaeas: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.