Solved

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

Posted on 2006-06-30
4
240 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 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