CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2001
    Location
    UK
    Posts
    308

    IIS Configuration for Sending Mail using CDONTS

    Hi,
    i'm using CDONTS.Newmail, object to send the mails to the extranal account like [email protected].. but the mails are not delivered to the given account.

    is there any configuration is required to be done in the IIS server for SMTP server to send the mails..

    the code is
    Code:
                    dim mail
    	set mail = Server.CreateObject("CDONTS.Newmail")
    	mail.From = "[email protected]"
    	mail.To = "[email protected]"
    	mail.Subject = "This is a test mail"
    	mail.Body = "This a test mail body"
    	mail.Send
    	
    	Response.Write "<br>U'r mail is sent"
    Thanks in adv.
    Venu
    Venu Bharadwaj
    "Dream it. U can do it!"

  2. #2
    Join Date
    Oct 1999
    Location
    Colorado
    Posts
    288
    All you have to do is have the SMPT Service installed and running in order for it to work...

  3. #3
    Join Date
    Dec 2001
    Location
    UK
    Posts
    308

    it is installed

    Hi,
    SMTP is installed and it is running ver much..
    still i'm not able to send the mails...

    is there any other software required to acheive this...

    Thanks in adv.
    Venu Bharadwaj
    Venu Bharadwaj
    "Dream it. U can do it!"

  4. #4
    Join Date
    Oct 1999
    Location
    Colorado
    Posts
    288
    it may be working but you may not be getting the mail....the from address and to address must be valid e-mails...look in the inetpub directory and see if there are any mails waiting in the queue or if there are any mails in the bad mail folder....

    here is the code I use to send emails and it looks like you are also doing it right. so my guess is that you arent specifying valid emails....

    Code:
    Function sendEmail(strTo, strFrom, strSubject, strBody, emailType)
    	Dim objCDO
    	
        Set objCDO			= Server.CreateObject("CDONTS.NewMail")				' Create a new mail object
    	objCDO.To			= strTo												' Specify To address
    	objCDO.From			= strFrom											' Specify From address
    	objCDO.Subject		= strSubject										' Specify Subject
    	objCDO.BodyFormat	= emailType											' Specify email type -- 0 HTML
    	objCDO.MailFormat	= emailType											' Specify email type -- 0 HTML
    	objCDO.Body			= strBody											' Put content in
    	objCDO.Send																' Send the email
    	Set objCDO = Nothing													' Deallocate mail object
    End Function
    Matt

  5. #5
    Join Date
    Sep 2002
    Location
    egypt
    Posts
    13
    I tried the code but it does not work out

    the error tell me that "email object could not be created


    would you pls tell me where can I declare the function and when can I call it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured