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
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>