|
-
Jan 16th, 2007, 07:33 AM
#1
Thread Starter
Fanatic Member
[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:
Dim mail As New Mail.MailMessage
Dim SmtpMail As Mail.SmtpMail
mail.Subject = "this is a test email."
mail.Body = "mail body"
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1) 'basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "sender") 'set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "mypass") 'set your password here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 587)
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", True)
SmtpMail.SmtpServer = "smtp.myserver.com"
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
-
Jan 16th, 2007, 12:10 PM
#2
Re: [02/03] Could not access 'CDO.Message' object
The "Could not access 'CDO.Message' object." exception is usually a wrapper for a more descriptive exception - have a look at the exceptionInstance.InnerException property, or easier still - Console.WriteLine(exceptionInstance.ToString()), to get the real problem.
-
Jan 16th, 2007, 12:25 PM
#3
Thread Starter
Fanatic Member
Re: [02/03] Could not access 'CDO.Message' object
that is what i got
----------
System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server. --- End of inner exception stack trace --- at System.RuntimeType.Inv...........
-
Jan 18th, 2007, 02:57 AM
#4
Thread Starter
Fanatic Member
Re: [02/03] Could not access 'CDO.Message' object
-
Jan 18th, 2007, 03:57 AM
#5
Thread Starter
Fanatic Member
-
Jan 22nd, 2007, 12:54 PM
#6
Re: [02/03] Could not access 'CDO.Message' object
Quite possibly may have been configured that way. Who configured your SMTP?
-
Jan 22nd, 2007, 11:27 PM
#7
Thread Starter
Fanatic Member
Re: [02/03] Could not access 'CDO.Message' object
 Originally Posted by mendhak
Quite possibly may have been configured that way. Who configured your SMTP?
i didn't get you.
i am not using any smtp client.
I am using vb.net /asp.net to directly connect to gmail smtp server and send mails.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|