Solved

Error while sending mail from asp.net app in windows 2003 m/c.

Posted on 2006-06-30
4
232 Views
Last Modified: 2011-04-14
Hi,

I have a .NET application in which i need to send auto-emails.

The application works fine in windows 2000/xp machines. But it fails in windows 2003 m/c.

Error Message : Could not access 'CDO.Message' object.


This is my code.
********************************************************************
      Dim oPriMail As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
        Dim oPriSMTP As System.Web.Mail.SmtpMail

        oPriMail.From = <from address>
        oPriMail.To = <to address>
        oPriMail.Subject = <subject>
        oPriMail.BodyFormat = System.Web.Mail.MailFormat.Html
        oPriMail.Body = <content>

        oPriSMTP.SmtpServer = <smtp server address that is being set at my outlook 2003>
        oPriMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60)

        oPriSMTP.Send(oPriMail)
********************************************************************

I have the Outlook 2003 installed in 2003 m/c. How do i know whether CDO is installed
and have the proper access rights.

I have also tried giving "localhost" for the SmtpServer but in vein.

Can anyone help me in solving this problem.
0
Comment
Question by:Simonho888
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 125 total points
ID: 17019037
Maybe this will be of some help:

    http://www.systemwebmail.com/faq/4.2.3.aspx
0
 

Author Comment

by:Simonho888
ID: 17029872
Hi,

I tried out many possible solutions from your link but still i get the errors...

Error Message with Inner Exceptions:
-------------------------------------------

The following exception occurred:
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 (0x8004020E): The server rejected the sender address. The server response was: 530 5.7.0 Must issue a STARTTLS command first 8sm1065813nzn --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at ASP.test1_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in c:\inetpub\wwwroot\rorental\temp_test\test1.aspx:line 27
--------------------------------
The following InnerException reported:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8004020E): The server rejected the sender address. The server response was: 530 5.7.0 Must issue a STARTTLS command first 8sm1065813nzn --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
--------------------------------
The following InnerException reported:
System.Runtime.InteropServices.COMException (0x8004020E): The server rejected the sender address. The server response was: 530 5.7.0 Must issue a STARTTLS command first 8sm1065813nzn
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17029974
0
 

Author Comment

by:Simonho888
ID: 17030069
Solution:
----------
I set smtpserver to blank -> "".

System.Web.Mail.SmtpMail.SmtpServer= ""
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now