Hello Frank,
Thanks for sharing it with us. I believe it could help web email programmers much in this group.
Best regards,
Yanhong Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!Content-Class: urn:content-classes:message
!From: "Frank" <
[email protected]>
!Sender: "Frank" <
[email protected]>
!References: <
[email protected]> <uqb#
[email protected]>
<
[email protected]>
!Subject: Re: ASP.NET MailMessage in XP fails
!Date: Wed, 30 Jul 2003 11:20:32 -0700
!Lines: 110
!Message-ID: <
[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNWx0NEjufaGK23R/aVA5UkFC7z0Q==
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:163483
!NNTP-Posting-Host: TK2MSFTNGXA06 10.40.1.53
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!This solution came from Microsoft's Exchange group:
!
!In earlier versions of Windows 2000, access to the local
!SMTP server was automatically open to any computer that
!tried to use it. In code, you did not need to specify
!the SMTP server, and it would default to the local
!machine and work.
!
!Later in Win 2k, and in XP, 2003, etc, this was
!tightened - you have to specifically give access to the
!smtp server. In IIS, you go to the Properties of the
!default smtp server, Access, Relay, and Add the local
!computer IP address or name to the list.
!
!And, in code, you must specify the smtpserver property.
!
!It works, but re-opens the possibility that some
!unauthorized outsider might use your machine to relay
!messages.
!
!Frank
!
!
!
!
!>-----Original Message-----
!>Ray - thanks for responding - but, no, setting the
!>SmtpServer property to either "localhost" or another
!>available (working) smtp server does not change anything
!>for better or worse.
!>
!>I also made the ASPNET account (aspnet_wp, right?) an
!>administrator. I've had some trouble before from
!folders
!>that didn't have web sharing turned on, so I did that
!for
!>the mailroot and its subfolders - no change.
!>
!>The message, "Could not access 'CDO.Message' object",
!and
!>the fact that mail works fine from Windows Forms apps on
!>the same machine, makes it sound like it's an ASP.NET or
!>IIS issue.
!>
!>There were also some Windows 2003 Server questions today
!>on the same topic, but none of the responses shed any
!>light on this for me.
!>
!>Do you have any more suggestions?
!>
!>Thanks. Frank
!>
!>
!>
!>
!>
!>>-----Original Message-----
!>>Hi Frank,
!>>
!>>Does setting the SmtpServer property to "localhost" (or
!>whatever your SMTP
!>>server is) fix it? If not, try checking the ASPNET
!>account's permissions on
!>>the mailroot's folders.
!>>
!>>
!>>--
!>>Ray Dixon - Microsoft MVP
!>>
[email protected]
!>>(remove NOSPAM. from my e-mail address for a direct
!>reply)
!>>
!>>
!>>!>>> Straightforward VB.NET 2002 code that works form both
!>>> Windows and ASP.NET apps on a Windows 2000 machine,
!and
!>>> works in the Windows app on a newly installed XP
!>machine,
!>>> but fails in the ASP.NET code on XP. The unhandled
!>>> exception is "COMException: The 'SendUsing'
!>configuration
!>>> value is invalid." If I handle the exception, the
!>>> exception's Message is "Could not access 'CDO.Message'
!>>> object."
!>>>
!>>> The essence of the code is:
!>>> Imports System.Web.Mail
!>>> ...
!>>> Dim m as New MailMessage()
!>>> m.From = ...set all properties
!>>> smtpmail.send(m)
!>>>
!>>> There are no attachments, but adding attachments to
!any
!>>> of the 4 versions of the app does not change the
!>results.
!>>> The smtp server is the local machine in all cases, and
!>>> changing that does not change the results.
!>>>
!>>> I'd welcome any ideas.
!>>>
!>>> Thanks.
!>>
!>>
!>>.
!>>
!>.
!>
!