Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'CDO.Message' error thrown only for one row rest of them its sending

Status
Not open for further replies.

Kingkumar

Programmer
Jan 21, 2003
167
0
0
US
Hi ,
I am facing this weired problem for some set of data i am getting follwoing exception message. I am working on a windows vb.net application

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 (0x80040211): The message could not be sent to the SMTP server. The transport error code was 0x800ccc6a. The server response was 451 Timeout waiting for client input


any one can please point me to where to place this message or any ideas about it .
Thanks
Regards,
King
 
What code caused the error? I'm assuming you are working with a CDO com object to send email. All the error says is that the server was waiting for you to send it something.

-Rick

----------------------
 
HI Rick,
following is my codesnippet

Try
Dim email As New MailMessage
With email
.To = Recipient
.From = From
.Subject = Subject
.Body = Header
If (Bcc <> String.Empty) Then
.Bcc = Bcc
End If
End With

If smtpServer <> String.Empty Then
SmtpMail.SmtpServer = smtpServer
End If
Dim i As Integer
email.Fields(" = port
email.BodyEncoding = System.Text.Encoding.UTF8
' Try
SmtpMail.Send(email)
' Catch ex As Exception

' End Try
'Sleep for 2 Secs
Sleep(2000)

Catch ex As Exception
'MsgBox(ex.Message)
If InStr(ex.InnerException.InnerException.ToString, " The server rejected one or more recipient addresses. ") > 0 Then
BLog.Log("Could not Send Email To :" & Recipient)
Else
BLog.Log(lngorderprocessedcount & " Orders have been processed")
BLog.Log(vbNewLine & ex.ToString)
BLog.Log(" **************** The InnerExceptions -InnerException is Below *******")
BLog.Log(vbNewLine & ex.InnerException.InnerException.ToString)
Throw New Exception("Error Sending Email ** Check Email Settings ** " & vbCrLf & ex.Message)
End If
End Try
 
Hey Kingreen,
The only thing in the code that I would worry about is the smtpServer part. the server is required, make sure that this string is filled and is populating the SMTPServer property of the Mail object.

If that's not it then it is most likely an email service configuration issue. check this link for a bunch of information:
-Rick

----------------------
 
Hay ThatRickGuy..

I'm getting the same error message "Could not access 'CDO.Message' object", It worked a couple of times now nothing.. I'm trying to pass the E-Mail through a ISP mail server... I think its needing a User Name and Password for Authentication before it will allow the mail.. But how would I add in the logon user information in the code??

Dim oMail As MailMessage
Dim sLoggedOnPatronID As String

oMail = New MailMessage()

With oMail
.From = Textbox1.Text
.To = TextBox2.Text
.Subject = textbox3.Text
.Priority = MailPriority.Normal
.BodyFormat = MailFormat.Text
.Body = Textbox4.Text
End With

SmtpMail.SmtpServer = "<Mail Server Name Here>"
SmtpMail.Send(oMail)

oMail = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top