Problem on sending Email through .Net exe or VB6 exe

G

Guest

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: (e-mail address removed)
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.

(e-mail address removed)




--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;[email protected]
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: <[email protected]>
To: <[email protected]>
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--
 
S

Steve Schroeder

Forgive the none-too-subtle sarcasm but what part of this post relates to
ADO.Net?

Beve Lyni said:
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: (e-mail address removed)
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.

(e-mail address removed)




--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;[email protected]
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: <[email protected]>
To: <[email protected]>
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--
 
V

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



Beve Lyni said:
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: (e-mail address removed)
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.

(e-mail address removed)




--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;[email protected]
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: <[email protected]>
To: <[email protected]>
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--
 
K

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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top