Home All Groups Group Topic Archive Search About

Problem on sending Email through .Net exe or VB6 exe

Author
28 Mar 2005 3:31 PM
Beve Lyni
I am running on Windows 2000 Professional with SP4. I have my SMTP server
started.

Thank you in advance for your support.

Try #1:
The code in .Net as in the following

        Imports System.Web.Mail

    Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
                    Message.To = ToAddress
                    Message.From = FromAddress
                    Message.Subject = “Hello”
                    Message.Body = “Test”
                    Try
                        SmtpMail.SmtpServer = MyServerName
                        SmtpMail.Send(Message)
                    Catch ehttp As System.Web.HttpException
                        Console.WriteLine("0", ehttp.Message)
                    End Try

The error was caught stating, "Could not access 'CDO.Message' object."


Try #2
Then I tried to use VB6 code to send out email as in the following:

Sub Main()

    Dim objNewMail As CDONTS.NewMail
    Dim sMsg As String

On Error GoTo Handler

    Set objNewMail = New CDONTS.NewMail
    objNewMail.Subject = "Hello"
    objNewMail.Body = "test"
    objNewMail.From = FromAddress
    objNewMail.To = ToAddress
    objNewMail.Send

    Set objNewMail = Nothing

Handler:
If Err.Number <> 0 Then
    MsgBox (Err.Description)
    Err.Clear
End If
End Sub

No error was caught. However, the mails were listed in the
\Inetpub\mailroot\BadMail folder as given below:

From: postmaster@CMDGNOR050277
To: some***@reedbusiness.com
Date: Fri, 25 Mar 2005 16:00:42 -0500
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
    boundary="9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277"
Message-ID: <5QXb66sJd00000001@CMDGNOR050277>
Subject: Delivery Status Notification (Failure)

This is a MIME-formatted message. 
Portions of this message may be unreadable without a MIME-capable mail
program.

--9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
Content-Type: text/plain; charset=unicode-1-1-utf-7

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

       some***@reedbusiness.com




--9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
Content-Type: message/delivery-status

Reporting-MTA: dns;CMDGNOR050277
Received-From-MTA: dns;CMDGNOR050277
Arrival-Date: Fri, 25 Mar 2005 16:00:41 -0500

Final-Recipient: rfc822;some***@reedbusiness.com
Action: failed
Status: 5.0.0
Diagnostic-Code: smtp;550 Relaying is prohibited


--9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
Content-Type: message/rfc822

Received: from mail pickup service by CMDGNOR050277 with Microsoft SMTPSVC;
    Fri, 25 Mar 2005 16:00:41 -0500
From: <some***@reedbusiness.com>
To: <some***@reedbusiness.com>
Subject: Koroseal
Date: Fri, 25 Mar 2005 16:00:41 -0500
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <CMDGNOR050277KYuRid00000001@CMDGNOR050277>
X-OriginalArrivalTime: 25 Mar 2005 21:00:41.0835 (UTC)
FILETIME=[B477CBB0:01C5317D]




--9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277--


--
Beve

Author
28 Mar 2005 4:20 PM
Steve Schroeder
Forgive the none-too-subtle sarcasm but what part of this post relates to
ADO.Net?

"Beve Lyni" <bevelyni@nospam.nospam> wrote in message
news:2B80F544-270D-4AC6-BB84-C151D80937F2@microsoft.com...
> I am running on Windows 2000 Professional with SP4. I have my SMTP server
> started.
>
> Thank you in advance for your support.
>
> Try #1:
> The code in .Net as in the following
>
> Imports System.Web.Mail
>
>   Dim Message As System.Web.Mail.MailMessage = New
System.Web.Mail.MailMessage
Show quote
>                     Message.To = ToAddress
>                     Message.From = FromAddress
>                     Message.Subject = "Hello"
>                     Message.Body = "Test"
>                     Try
>                         SmtpMail.SmtpServer = MyServerName
>                         SmtpMail.Send(Message)
>                     Catch ehttp As System.Web.HttpException
>                         Console.WriteLine("0", ehttp.Message)
>                     End Try
>
> The error was caught stating, "Could not access 'CDO.Message' object."
>
>
> Try #2
> Then I tried to use VB6 code to send out email as in the following:
>
> Sub Main()
>
>     Dim objNewMail As CDONTS.NewMail
>     Dim sMsg As String
>
> On Error GoTo Handler
>
>     Set objNewMail = New CDONTS.NewMail
>     objNewMail.Subject = "Hello"
>     objNewMail.Body = "test"
>     objNewMail.From = FromAddress
>     objNewMail.To = ToAddress
>     objNewMail.Send
>
>     Set objNewMail = Nothing
>
> Handler:
> If Err.Number <> 0 Then
>     MsgBox (Err.Description)
>     Err.Clear
> End If
> End Sub
>
> No error was caught. However, the mails were listed in the
> \Inetpub\mailroot\BadMail folder as given below:
>
> From: postmaster@CMDGNOR050277
> To: some***@reedbusiness.com
> Date: Fri, 25 Mar 2005 16:00:42 -0500
> MIME-Version: 1.0
> Content-Type: multipart/report; report-type=delivery-status;
> boundary="9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277"
> Message-ID: <5QXb66sJd00000001@CMDGNOR050277>
> Subject: Delivery Status Notification (Failure)
>
> This is a MIME-formatted message.
> Portions of this message may be unreadable without a MIME-capable mail
> program.
>
> --9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
> Content-Type: text/plain; charset=unicode-1-1-utf-7
>
> This is an automatically generated Delivery Status Notification.
>
> Delivery to the following recipients failed.
>
>        some***@reedbusiness.com
>
>
>
>
> --9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
> Content-Type: message/delivery-status
>
> Reporting-MTA: dns;CMDGNOR050277
> Received-From-MTA: dns;CMDGNOR050277
> Arrival-Date: Fri, 25 Mar 2005 16:00:41 -0500
>
> Final-Recipient: rfc822;some***@reedbusiness.com
> Action: failed
> Status: 5.0.0
> Diagnostic-Code: smtp;550 Relaying is prohibited
>
>
> --9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
> Content-Type: message/rfc822
>
> Received: from mail pickup service by CMDGNOR050277 with Microsoft
SMTPSVC;
> Fri, 25 Mar 2005 16:00:41 -0500
> From: <some***@reedbusiness.com>
> To: <some***@reedbusiness.com>
> Subject: Koroseal
> Date: Fri, 25 Mar 2005 16:00:41 -0500
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
> Message-ID: <CMDGNOR050277KYuRid00000001@CMDGNOR050277>
> X-OriginalArrivalTime: 25 Mar 2005 21:00:41.0835 (UTC)
> FILETIME=[B477CBB0:01C5317D]
>
>
>
>
> --9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277--
>
>
> --
> Beve
Author
29 Mar 2005 2:03 AM
Kevin Yu [MSFT]
Hi Beve,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you're getting an exception, which says
"Could not access 'CDO.Message' object." when trying to send a mail message
using the System.Web.Mail namespace. If there is any misunderstanding,
please feel free to let me know.

Based on my research, I have found a similar issue to this symptom. We have
to change settings on the Internet Mail Service Property Pages to allow
relaying for internal ip addresses. Please try the following steps:

1. Checked the option under the Routing Restrictions under the Routing Tab
for the Internet Mail Connector "hosts and clients connecting to these
internal IP addresses".
2. Stopped and restarted the IMS.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Author
29 Mar 2005 1:27 AM
Val Mazur (MVP)
Hi,

Could be permissions issue. If your SMTP server requires authentication,
then you will get this error. Try to catch exception and check what is in
InnerException property and StackTrace property. It could give you more
detail information about the actual problem
--
Val Mazur
Microsoft MVP

http://xport.mvps.org



Show quote
"Beve Lyni" <bevelyni@nospam.nospam> wrote in message
news:2B80F544-270D-4AC6-BB84-C151D80937F2@microsoft.com...
>I am running on Windows 2000 Professional with SP4. I have my SMTP server
> started.
>
> Thank you in advance for your support.
>
> Try #1:
> The code in .Net as in the following
>
> Imports System.Web.Mail
>
>  Dim Message As System.Web.Mail.MailMessage = New
> System.Web.Mail.MailMessage
>                    Message.To = ToAddress
>                    Message.From = FromAddress
>                    Message.Subject = "Hello"
>                    Message.Body = "Test"
>                    Try
>                        SmtpMail.SmtpServer = MyServerName
>                        SmtpMail.Send(Message)
>                    Catch ehttp As System.Web.HttpException
>                        Console.WriteLine("0", ehttp.Message)
>                    End Try
>
> The error was caught stating, "Could not access 'CDO.Message' object."
>
>
> Try #2
> Then I tried to use VB6 code to send out email as in the following:
>
> Sub Main()
>
>    Dim objNewMail As CDONTS.NewMail
>    Dim sMsg As String
>
> On Error GoTo Handler
>
>    Set objNewMail = New CDONTS.NewMail
>    objNewMail.Subject = "Hello"
>    objNewMail.Body = "test"
>    objNewMail.From = FromAddress
>    objNewMail.To = ToAddress
>    objNewMail.Send
>
>    Set objNewMail = Nothing
>
> Handler:
> If Err.Number <> 0 Then
>    MsgBox (Err.Description)
>    Err.Clear
> End If
> End Sub
>
> No error was caught. However, the mails were listed in the
> \Inetpub\mailroot\BadMail folder as given below:
>
> From: postmaster@CMDGNOR050277
> To: some***@reedbusiness.com
> Date: Fri, 25 Mar 2005 16:00:42 -0500
> MIME-Version: 1.0
> Content-Type: multipart/report; report-type=delivery-status;
> boundary="9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277"
> Message-ID: <5QXb66sJd00000001@CMDGNOR050277>
> Subject: Delivery Status Notification (Failure)
>
> This is a MIME-formatted message.
> Portions of this message may be unreadable without a MIME-capable mail
> program.
>
> --9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
> Content-Type: text/plain; charset=unicode-1-1-utf-7
>
> This is an automatically generated Delivery Status Notification.
>
> Delivery to the following recipients failed.
>
>       some***@reedbusiness.com
>
>
>
>
> --9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
> Content-Type: message/delivery-status
>
> Reporting-MTA: dns;CMDGNOR050277
> Received-From-MTA: dns;CMDGNOR050277
> Arrival-Date: Fri, 25 Mar 2005 16:00:41 -0500
>
> Final-Recipient: rfc822;some***@reedbusiness.com
> Action: failed
> Status: 5.0.0
> Diagnostic-Code: smtp;550 Relaying is prohibited
>
>
> --9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277
> Content-Type: message/rfc822
>
> Received: from mail pickup service by CMDGNOR050277 with Microsoft
> SMTPSVC;
> Fri, 25 Mar 2005 16:00:41 -0500
> From: <some***@reedbusiness.com>
> To: <some***@reedbusiness.com>
> Subject: Koroseal
> Date: Fri, 25 Mar 2005 16:00:41 -0500
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
> Message-ID: <CMDGNOR050277KYuRid00000001@CMDGNOR050277>
> X-OriginalArrivalTime: 25 Mar 2005 21:00:41.0835 (UTC)
> FILETIME=[B477CBB0:01C5317D]
>
>
>
>
> --9B095B5ADSN=_01C5317D8C02842000000001CMDGNOR050277--
>
>
> --
> Beve

AddThis Social Bookmark Button