Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-06-30
4
Medium Priority
?
257 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

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)…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

604 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