Community discussion forum

help on CDONTS

  • 1 year ago

    Hi to all Developpesm i want to send e-mai with ASP using CDONTS on Windows 2003 sever but it is not be received and it doesnt show me any error

    and this is the code and i have installed the cdonts components well and if i use telnet it replies so the SMTP also works Dim MyBody Dim MyCDONTSMail Set MyCDONTSMail = CreateObject("CDONTS.NewMail") MyCDONTSMail.From= "some@yahoo.com" MyCDONTSMail.To= "someone@gmail.com" MyCDONTSMail.Subject="This is a Test" MyBody = "Thank you for ordering that stuff" & vbCrLf MyBody = MyBody & "We appreciate your business" & vbCrLf MyBody = MyBody & "Your stuff will arrive within 7 business days" MyCDONTSMail.Body= MyBody MyCDONTSMail.Send set MyCDONTSMail=nothing

  • 1 year ago
    Helo First you have to check that you send message to a right smtp server.
  • 1 year ago
    Helo First you have to check that you send message to a right smtp server.
  • 1 year ago

    hello

    first , you have to check on which smtp server you send message.

    if you are using IIS 6.0 and asp ( aspx may be ) the default smtp server is the integrated one .

    the messages sent can be find int the c:\inetpub\mailroot\queue  folder.
    if you wish to use the server's smtp , you will have to correctly set the parameters.

    this is all that i can tell you at this point, without more precisions from you  

    1) send a mail

    2) check the queue folder.

    3 ) check badmail folder   

  • 1 year ago

    Yes i checked in the  c:\inetpub\mailroot\queue  folder

    the messages are being stuck in there and i have now used the cdo.Message

    but still i have the same problem this is my code

    <%
    '### DIM Object sets ###
    DIM objCDOMail, objConfig, Fields, sch

    'Create the e-mail and config server objects
    Set objCDOMail = CreateObject("CDO.Message")
    Set objConfig = CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields

    sch = "http://schemas.microsoft.com/cdo/configuration/"
    '### - OPTION 2 - ###
    '#################################################    #############
    '### LOCAL HOST / IIS VIRTUAL SMTP SERVER CONFIG VALUE ########
    With Fields
        .Item(sch & "sendusing") = 1
        .Item(sch & "smtpserver") = "my server ip"
        .Item(sch & "smtpserverport") = 25 
        .Item(sch & "smtpconnectiontimeout") = 10
        .Item(sch & "smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
        .update
    End With
    '#################################################    #############


    With objCDOMail
        Set .Configuration = objConfig
        .From = "me@gmail.com"
        .To = "you@gmail.com"
        .Subject = "Test message using CDOSYS"
        .TextBody = "YOUR TEXT BODY MESSAGE."
        .Send
    End With

    '### clean up section ####
    Set objCDOMail = Nothing
    Set Fields = Nothing
    Set objConfig = Nothing

    %>

     

    Thx and any help will be appreciated  and am using windows 2003 server

  • 1 year ago

    hi man ..

    if your mails still stuck in the queue, this means that the default smtp server is not set correctly.

    open IIS configuration prg

    right click on the default smtp server, properties.

    it will be too long to explain the "how to" here but you can check some parameters like , active server, delivery timeout etc.

    I had the same problem as yours and i have fixed it by addind a "true" smtp server ( i mean my office's smtp server ) as active server and i have check the "try direct delivery before sending to the active server"

    this works fine for me ..

    in asp.net using framework 2.0 :

     

    smtpmail.Host = "someSmtpServer"

    smtpmail.Port = "SomeSmtpPort"

     

    Dim Mess As New MailMessage

    Dim Exped As New MailAddress("me@me.com")

    Dim MailReceip As New MailAddress("you@you.com")

    Mess.From = Exped

    Mess.To.Add(MailReceip)

     

     

    Mess.IsBodyHtml = True

    Mess.Subject =

     

    "put some stext here"

    Mess.Body = mailBody

     

    ' message send

    Mess.Priority = MailPriority.High

    smtpmail.Send(Mess)

     

    ' clean the object here

     

    don't forget to import the "System.net.mail" namespace

    serval

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!