Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

790 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