Sent Email Using VbScript

Posted on 2004-11-24
Last Modified: 2008-03-03
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 = ""
   '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

    LVL 2

    Accepted Solution

    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

    set sendmail = nothing
    set objrs = nothing


    Author Comment

    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.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    bunnyEars challenge 6 47
    endX challenge 2 33
    strCount chalenge 3 36
    wordappend challenge 8 56
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now