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.
 

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,052
Programming Experience
10+
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...
 

LookitsPuck

Active member
Joined
Jan 23, 2007
Messages
37
Programming Experience
3-5
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.
 

juggernot

Well-known member
Joined
Sep 28, 2006
Messages
173
Programming Experience
Beginner
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:

alvinblim

Well-known member
Joined
Jan 7, 2006
Messages
46
Location
malaysia
Programming Experience
3-5
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
 

alvinblim

Well-known member
Joined
Jan 7, 2006
Messages
46
Location
malaysia
Programming Experience
3-5
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)
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,553
Location
Norway
Programming Experience
10+
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
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,553
Location
Norway
Programming Experience
10+
No can't do. How about changing your forum profile? (or your Studio ;)) Then check one of the sites I recommended.
 

alvinblim

Well-known member
Joined
Jan 7, 2006
Messages
46
Location
malaysia
Programming Experience
3-5
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.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,553
Location
Norway
Programming Experience
10+
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.
 

alvinblim

Well-known member
Joined
Jan 7, 2006
Messages
46
Location
malaysia
Programming Experience
3-5
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.
 

edelman

New member
Joined
Feb 5, 2007
Messages
3
Programming Experience
1-3
help!

hey everyone -

i have a pretty big problem here... i haven't changed anything in the way of how email is sent from my site for a while. my code works, i have a valid [to] and [from] address. however, as of like a week ago, i have started to receive the "cannot create CDO object" error message, and I have no idea why. my site is being hosted elsewhere by a hosting service, so i don't really have control over the server. i can still send and receive emails using email clients, so the email server isn't down, but now we are crippled in the respect that we can't send confirmation emails and the like when something happens on the site (ie, when someone orders something!)

PLEASE help...thanks!

Jason

error:
The following exception occurred: System.Web.HttpException: Could not create 'CDO.Message' object. at System.Web.Mail.LateBoundAccessHelper.get_LateBoundType() at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,553
Location
Norway
Programming Experience
10+
edelman, if you'd read this thread you would know what to do and what to post here if that didn't already answer your question. Inspect/post the InnerException(s), see code box post 4.
 

edelman

New member
Joined
Feb 5, 2007
Messages
3
Programming Experience
1-3
John H -

Thanks for your reply. I did, in fact, read this thread, and did, in fact, check the inner exceptions, of which there are none. The reason why I posted is because I am still having problems. Thanks.

Jason
 
Top Bottom