Results 1 to 7 of 7

Thread: [02/03] Could not access 'CDO.Message' object

Threaded View

  1. #1

    Thread Starter
    Fanatic Member vishalmarya's Avatar
    Join Date
    Feb 2001
    Location
    New Delhi , INDIA
    Posts
    858

    Resolved [02/03] Could not access 'CDO.Message' object

    i am using the following code to send an email from a asp.net (1.1 ) page

    err i am getting is ,

    The transport failed to connect to the server.

    if i use try catch block then
    ex.message returns "Could not access 'CDO.Message' object."


    VB Code:
    1. Dim mail As New Mail.MailMessage
    2.         Dim SmtpMail As Mail.SmtpMail
    3.  
    4.         mail.To = "[email protected]"
    5.         mail.From = "[email protected]"
    6.         mail.Subject = "this is a test email."
    7.         mail.Body = "mail body"
    8.         mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1) 'basic authentication
    9.         mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "sender") 'set your username here
    10.         mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "mypass") 'set your password here
    11.         mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 587)
    12.         mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", True)
    13.  
    14.         SmtpMail.SmtpServer = "smtp.myserver.com"
    15.         SmtpMail.Send(mail)


    1. the error is generated when i run the aspx page on my dev machine ( win xp pro sp2 iis 5.1)

    2. but it works fine if i put the page on my smtp server ( "smtp.myserver.com" )

    3. what makes it complicated is , it also works in vs 2005 using net.mail namespace ( on the same machine of case 1 )

    somebody got to help me on this.

    Thanks.
    Last edited by vishalmarya; Jan 18th, 2007 at 04:04 AM. Reason: resolved
    Vishal Marya, MCP .net 3.5
    My Site
    http://www.vstoolsgallery.com/
    http://visualstudiogallery.msdn.micr...b-f87a909b9266





    Please indicate what version of vb you use.
    Please mark your thread resolved using the Thread Tools above.
    -----------------------------------------

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