Re: form to email script

by "Phil Collis" <phil(at)>

 Date:  Wed, 18 Apr 2001 11:08:04 +0100
 To:  <hwg-basics(at)>
 References:  bkrweb
  todo: View Thread, Original

----- Original Message -----
From: "bkrWeb Services" <bkrweb(at)>
To: <hwg-basics(at)>
Sent: Wednesday, April 18, 2001 4:13 AM
Subject: form to email script

> I have taken over the administration of a website.  The site is on an NT
> server.  All I've used previously has been UNIX.  The customer wants a
> on the site.  There was not one on it previously.  I can code it with no
> problems.  What I need is a means to send the results.  Again, I've only
> used Matt's formmail in the past.  I have found an NT version of Matt's,
> but it needs to know where the sendmail.exe file is.  I've been told I can
> add that to the cgi-bin myself.  Is that something I want to do, and where
> would I find it?   I have asked the tech support people about forms and
> they said it was no problem -- just do such and so with FrontPage.  I
> explained that I don't use FrontPage.  They acted like I was an
> alien.  Anybody have any good sources for NT form to email scripts?
> Kathie Riechmann
You could use a little Active Server Pages scripting with CDONTS ...
submit the form to an Active Server Page ...
    Dim myCDONTSMail
    Dim strFrom
    Dim strTo
    Dim strSubject
    Dim strMessage
    Dim lngImportance

    strFrom=Request.Form("[field in form holding the sender's name/email
    !!! NB !!! strip spaces - a CDONTS quirk means you cannot have any
spaces in the name (strFrom)
    strTo=Request.Form("[destination email address]")
    strSubject = "[type in your subject matter]"
    strBody="[body of message]" & vbCrLf
    strBody=strBody & [more ...]
    lngImportance = "1"
    Set myCDONTSMail = CreateObject("CDONTS.NewMail")
    myCDONTSMail.Send "website",strTo,strSubject,strBody,lngImportance
    Set myCDONTSMail  = Nothing

Phil Collis

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA