Results 1 to 5 of 5

Thread: sending mails using cdont

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    24
    anyone has a working example of how cdont work?
    thanxs

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi LoverPal

    Using CDONTS in asp is quite easy, just use the following code

    Code:
    Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
            'set its properties
            objCDOMail.From = 'Email address that you want it from
            objCDOMail.To = 'who you want to send it to
            objCDOMail.Subject = 'any string
            objCDOMail.Body = 'anystring
            'send the mail
            objCDOMail.Send
            'set the object = nothing
            Set objCDOMail = Nothing
    Hope it helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3
    Guest

    Post JavaScript

    Here is an example for the JavaScript and or JScript.
    Code:
    var oMail;
    
    // get a mail object
    oMail = Server.CreateObject ( 'CDONTS.NewMail' );
    
    oMail.From = sFromEmail;
    
    oMail.To = sToEmail;
    oMail.Bcc = sBccEmail;
    oMail.Importance = 1;
    
    // if you want HTML mail...
    // uncomment the next two lines
    // oMail.BodyFormat = 0;
    // oMail.MailFormat = 0;
    
    // if you want to attach a file...
    // uncomment the next line
    // oMail.AttachFile ( 'c://autoexec.bat' );
    
    oMail.Subject = sSubject;
    oMail.Body = sBody;
    
    // send it
    oMail.Send ();

  4. #4

    anyone know how to forward?

    I would like to use the built in SMTP server that comes with windows 2k Server but it won't forward emails to other email addresses.
    I was thinking that it might be possible since when u create users in the Active Dir, there's a field for email address.
    How can I get the SMTP server to send mail to that email field??
    if its not possible the way win 2k server comes, any recommendations to begin coding?

  5. #5
    Lively Member harsoni's Avatar
    Join Date
    Oct 2000
    Posts
    118

    Smile

    Hi,
    If you are having Win2k, then u can use CDO object to
    configure SMTP server.

    .....

    objMessage = Server.CreateObject("CDO.Message")
    Set objConfiguration = Server.CreateObject("CDO.Configuration")
    Set colFields = objConfiguration.Fields
    colFields(cdoSendUsingMethod) = cdoSendUsingPort
    colFields(cdoSMTPServer) = "Your Mail Server"
    colFields(cdoSMTPConnectionTimeout) = 10
    colFields(cdoSMTPAuthenticate) = cdoAnonymous

    sonia

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