I have a below code to send email in classic asp,but both are not workig.Would you check it?I'm coding in widows7 OS

Venkateshjayaramu 6 Reputation points
2022-10-26T06:43:11.3+00:00

method1)using javascript:

<script type="text/jscript">
function sendEmail() {
Email.send({
Host: "smtp.gmail.com",
Username : "correct@Stuff .com",
Password : "correctpwd",
To : 'correct1@Stuff .com',
From : "correct@Stuff .com",
Subject : "Order-Export",
Body : "<email body>"
})
.then(function(message){
alert("mail sent successfully")
});
}
</script>

method2)using CDO oBject

<script type="text/vbscript">
function sendEmail() {
dim objMail
Set objMail = Server.CreateObject("CDO.Message")
dim smtpServer, yourEmail, yourPassword
smtpServer = "smtp.gmail.com"
yourEmail = "correct1@Stuff .com"
bjMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = correct@Stuff .com
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = correctpwd
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMail.Configuration.Fields.Update
objMail.Subject="Application Form Registration Details"
objMail.htmlBody = "This is test message"
objMail.Send
}
</script>

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,288 questions
0 comments No comments
{count} vote