CDO.Message

alvinblim

Well-known member
Joined
Jan 7, 2006
Messages
46
Location
malaysia
Programming Experience
3-5
I have face some cdo.message(fail to connect to the server) in my email system. Do any one have experience on it, please help me. thank you.
 
Thats like saying "Internet Explorer says 'cannot connect to server' - whats wrong?"

Or logging onto a car forum and saying "My car wont start. What's wrong?"



If you put some more effort into your question, im sure someone will put some effort into an answer!

ps; in .net, we use System.Net.Mail to send email...
 
Fail to connect to the server could be a variety of problems.

But as was said above, we use System.Net.Mail Or System.Web.Mail depending upon what version of .NET you're using.
 
that is just a generic error. You should try finding the innerexception. You can do that like this:
VB.NET:
Try
obj.Send(your mail information)
Catch ex As Exception
Me.TextBox.Text = ("the following exception occured:" & ex.ToString())
While Not (ex.InnerException Is Nothing)
Me.TextBox.Text += "------------------------"
Me.TextBox.Text += ("The following InnerException reported: " + ex.InnerException.ToString())
ex = ex.InnerException
End While
End Try
It could really be as simple as not using the correct smtp server. When I tried, I had to use my ISP's smtp server for some reason. Also, for some reason your smtp port may be closed or blocked.
 
Last edited by a moderator:
This is my sample code

i am so sorry tat i dint give more detail on my problem. i try to use my own pc email account to send email. i am using visual studio 2003 to write it and OS is windows xp Pro sp2. Thx a lot to the ppl who reply me.

Dim mail As New System.Web.Mail.MailMessage
Dim mailServer As System.Web.Mail.SmtpMail

mail.From=""
mail.To = ""
mail.Subject = "Meeting"
mail.Body = "this is testing message"


' local network to the SmtpServer property.
SmtpMail.SmtpServer = "43.74.93.218" 'my computer ip.
Try
System.Web.Mail.SmtpMail.Send(mail)

MsgBox("Send complete")
Catch ex As Exception
MessageBox.Show(("The following exception occurred: " + ex.ToString()))
'check the InnerException
While Not (ex.InnerException Is Nothing)
Console.Write("--------------------------------")
MessageBox.Show(("The following InnerException reported: " + ex.InnerException.ToString()))
ex = ex.InnerException
End While
End Try
 
The error msg is:
The Following exception occurred:system.web.httpException:Could not create 'CDO.Message'object.
at system.web.mail.lateBoundAccessHelper.Get_LateBoundType()
at system.web.mail.lateBoundAccessHelper.CreateInstance()
at System.web.mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
 
alvinblim, for .Net 2.0 as your forum profile currently states, the System.Net.Mail namespace has replaced System.Web.Mail. System.Net.Mail is not dependent of the CDO object that in some cases can be problematic. There are dedicated help sites for both namespaces at www.systemnetmail.com and www.systemwebmail.com
But as I say, go for System.Net.Mail
 
No can't do. How about changing your forum profile? (or your Studio ;)) Then check one of the sites I recommended.
 
okok.:) i change my profile already. sorry for confusing you. Actually both version i oso use, but sometime different company using different version of visual studio. i have testing use system.net.mail(visual studio 2005) to write it, it will not appear the cdo.message error msg. but tat mail alway stay at queue folder, it cant send out.
 
system.net.mail doesn't use the CDO subsystem. What queue folder are you talking about? I've not seen delay/queue for net.mail.
 
cjard. i dint put my real email at "To". but my real program i will write the email address.

JohnH
what i mean is i am using mail server. all the mail will send to mail server before send out to the receiver. if i using outlook function to send, it will successful to send out, but if i using system.net.mail, the mail will send to the IIS Queve folder(C:\Inetpub\mailroot\Queue). Why i dont like to use Outlook function( outlook.dll) is bcs outlook function alway pop up the warning msg box before send out the mail.Moreover i have to click yes to send out the mail, if not the mail will not send out.
 
Back
Top