[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 609
  • Last Modified:

Sent Email Using VbScript

I had no idea what is going on with my  CDONTS

The code below is should be find, but somehow when ever user try to retrieve there password, the server won't sent out the email until I restart the computer.
My cdonts version 6.0.3939.0


<%
   'sets variables
email = request.form("email")
   'chooses username and password from database that correspond to submitted email address.
user = objrs.Fields("username")
pass = objrs.Fields("password")
Set sendmail = Server.CreateObject("CDONTS.NewMail")
   'put the webmaster address here
sendmail.From = "whateveraaa@whatever.com"
   'The mail is sent to the address entered in the previous page.
sendmail.To = email
   'Enter the subject of your mail here
sendmail.Subject = "The Login Information You Requested"
   'This is the content of thr message.
sendmail.Body = "The login Information you requested." & vbCrlf & vbCrlf _
& "Username=" & user & vbCrlf _
& "Password=" & pass & vbCrlf
   'this sets mail priority.... 0=low 1=normal 2=high
sendmail.Importance = 2
sendmail.Send
%>



0
QUANPROFILES
Asked:
QUANPROFILES
1 Solution
 
mcdown75Commented:
Do you set your connection objects and rs back to nothing?  If not, those variables are hanging out there until you shut down and restart.

Try adding

sendmail.close
set sendmail = nothing
objrs.close
set objrs = nothing

etc....
0
 
QUANPROFILESAuthor Commented:
Yeah I did

I just figure out the problem, that is the hotmail email. They though that my email was using for spam that's why, but thanks anyway. I'm going to use a different method instead of CDONTS or CDO.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now