?
Solved

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

Posted on 2006-06-30
4
Medium Priority
?
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 375 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 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