#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0

    Send Mail using vbscript


    Hi experts!

    I'm new to vbscript, asp & IIS.

    I've configured IIS in my computer and it's working fine. Every one in my local network can just type my computer's name and see my default page in their web browsers.

    I've already installed smtp server in my system, but have no idea how to work on it and how to send mails using my smtp server. I've tried & searched most of the sites where I can look for a simple example or a help.

    In most of the examples, I've seen (says simple again)
    <%Server.CreateObject("CDONTS.NewMail")%>
    but when I tried to see the page in browser, I got an error message as follows

    Server object, ASP 0177 (0x800401F3)
    Invalid class string
    /mail.asp, line 3

    What does that mean ? How can have this class installed in my system ? What r the steps. How can I send e-mails with just SMTP installed without using any activex controls ?

    Can I also receive mails ?

    Any help on this regard will be heighly appreciated!

    Jobin!
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,424
    Rep Power
    4539
    What windows? In XP and 2003, CDONTS is not installed, instead CDOSYS is installed. Search msdn for details on using the CDOSYS object.
    ======
    Doug G
    ======
    The man who doesn't read good books has no advantage over the man who can't read them.
    --Mark Twain
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0

    Thumbs down Thank you!


    Thank you very much Mr. Doug!

    Though I have not tried with CDOSYS in XP, I could do what I wanted with CDONTS in my web server.

    The codes I used is as follows:

    Dim MailObj
    Set MailObj = Server.CreateObject("CDONTS.NewMail")
    MailObj.From = "Web <web@domain.com>"
    MailObj.Cc = ""

    MailObj.To = "weber@domain.com"
    MailObj.Subject = "From Web"
    MailObj.Body = "Mail from web"
    MailObj.BodyFormat = 1
    MailObj.MailFormat = 0
    MailObj.Importance = 3
    MailObj.Bcc = ""
    MailObj.Attachfile "C:\path\Picturefile.gif", "Picture", 1

    MailObj.Send
    Set MailObj = Nothing

    This worked!!! Thanx for all those who helped!!!

    <b>Now may I ask if there is way to receive mails too ? Using any of these companonts ?</b>

    Thanx once again for the help!
    Jobin!
    Last edited by Jobin; April 5th, 2004 at 09:04 AM.

IMN logo majestic logo threadwatch logo seochat tools logo