Results 1 to 5 of 5

Thread: [RESOLVED] System.Web.Mail.MailMessage fails 1 in every 5 mails

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    56

    Resolved [RESOLVED] System.Web.Mail.MailMessage fails 1 in every 5 mails

    From my application which is running on a win2003 server, I send mail using .System.Web.Mail.MailMessage:

    Public Sub SendMail(ByVal FromText As String, _
    ByVal sendToText As String, ByVal SubjectText As String, _
    ByVal BodyText As String)
    If sendToText.ToString.Trim.Length >= 0 And FromText.ToString.Trim.Length > 0 Then
    myMessage = New MailMessage
    System.Web.Mail.SmtpMail.SmtpServer = "xxx.com"
    Try
    With myMessage
    .BodyFormat = MailFormat.Text
    .Priority = MailPriority.Normal
    .To = sendToText.ToString
    .From = FromText.ToString
    .Subject = SubjectText.ToString
    .Body = BodyText.ToString
    End With
    System.Web.Mail.SmtpMail.Send(myMessage)
    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Information)

    End Try


    Now what happens is, that there is an irregular CDO error message. The first time I run it, 4 messages are being sent and on number 5 I get a "Could not access CDO.message object" error. Then I send another 5 messages in a row, and number 3 would fail, or number 1. So no pattern at all.

    Anyone seen that behaviour before?
    Last edited by PVR; Jun 12th, 2006 at 01:20 PM. Reason: mailhub not hidden

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