Ask a Question related to ASP.NET General, Design and Development.
-
Frank #1
ASP.NET MailMessage in XP fails
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.
Frank Guest
-
xml: img tag fails
Hi. I am loading an external xml file into flash. Inside a cdata tag I have the following: <A... -
why this fails ???
HI All, I am trying to check the file exists before uploading to the server in our Unix box using <Cfftp> tag with action ="existsfile". this is... -
MailMessage Class
Hi, Did someone know if sending email with smtpmail.send to HOTMAIL cause any problem. My system send an automatic email to the user, but many... -
can i use and *.html file as the body in mailmessage class in ASP.net C#
i am tring to send email using mail message class in asp.net using C# language. can i use and *.html file as the body arg in mail message class.... -
ASP.NET Fails after SP4 with Impersonation
Michael, See http://support.microsoft.com/default.aspx?scid=kb;;821546 "Michael Kennedy " <mkennedy@REMOVETHIS.unitedbinary.com> wrote in... -
Ray Dixon [MVP] #2
Re: ASP.NET MailMessage in XP fails
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]ray@NOSPAM.greeble.com[/email]
(remove NOSPAM. from my e-mail address for a direct reply)
"Frank" <ftozier@nc.rr.com> wrote in message
news:000601c355eb$b3d93d20$a401280a@phx.gbl...> 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.
Ray Dixon [MVP] Guest
-
Frank #3
Re: ASP.NET MailMessage in XP fails
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
whatever your SMTP>-----Original Message-----
>Hi Frank,
>
>Does setting the SmtpServer property to "localhost" (oraccount's permissions on>server is) fix it? If not, try checking the ASPNETreply)>the mailroot's folders.
>
>
>--
>Ray Dixon - Microsoft MVP
>ray@NOSPAM.greeble.com
>(remove NOSPAM. from my e-mail address for a directmachine,>
>
>"Frank" <ftozier@nc.rr.com> wrote in message
>news:000601c355eb$b3d93d20$a401280a@phx.gbl...>> 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 XPconfiguration>> but fails in the ASP.NET code on XP. The unhandled
>> exception is "COMException: The 'SendUsing'results.>> 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>>> The smtp server is the local machine in all cases, and
>> changing that does not change the results.
>>
>> I'd welcome any ideas.
>>
>> Thanks.
>
>.
>Frank Guest
-
Frank #4
Re: ASP.NET MailMessage in XP fails
Jacky -
There is only one level of InnerException, "The server
rejected one or more recipient addresses. The server
response was: 550 5.7.1 Unable to relay for
[email]ftozier@nc.rr.com[/email]".
So my problem still is, why would the same code work from
a Windows app on this same (XP Pro) machine, and from
both Windows & asp.net on another machine?
Thanks.
Frank
anything>-----Original Message-----
>Frank wrote:>> Ray - thanks for responding - but, no, setting the
>> SmtpServer property to either "localhost" or another
>> available (working) smtp server does not changefolders>> for better or worse.
>>
>> I also made the ASPNET account (aspnet_wp, right?) an
>> administrator. I've had some trouble before fromfor>> that didn't have web sharing turned on, so I did thatand>> the mailroot and its subfolders - no change.
>>
>> The message, "Could not access 'CDO.Message' object",on>> the fact that mail works fine from Windows Forms appsor>> the same machine, makes it sound like it's an ASP.NETtoday>> IIS issue.
>>
>> There were also some Windows 2003 Server questions(or>> 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"and>>
>> 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
>>>ray@NOSPAM.greeble.com
>>>(remove NOSPAM. from my e-mail address for a direct
>> reply)
>>>>>
>>>"Frank" <ftozier@nc.rr.com> wrote in message
>>>news:000601c355eb$b3d93d20$a401280a@phx.gbl.. .
>>>
>>>>Straightforward VB.NET 2002 code that works form both
>>>>Windows and ASP.NET apps on a Windows 2000 machine,any>> machine,>>>>works in the Windows app on a newly installed XP
>>>
>>>> configuration>>>>but fails in the ASP.NET code on XP. The unhandled
>>>>exception is "COMException: The 'SendUsing'
>>>
>>>>>>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 tothe "InnerException" field of the>>> results.>>>>of the 4 versions of the app does not change the
>>>
>>>>>>>>The smtp server is the local machine in all cases, and
>>>>changing that does not change the results.
>>>>
>>>>I'd welcome any ideas.
>>>>
>>>>Thanks.
>>>
>>>
>>>.
>>>
>
>Could you use a debugger to trace intothe "Could not access>exception raised in send?
>
>In fact, the dotnet mail function just will throwone in the>'CDO.Message' object.", but the actual problem is thethe "InnerException" of the>"InnerException". You may need to find>"InnerException" until no deeper "InnerException".
>
>You can also change the code to make a loop to print the
>"InnerException" until the "InnerException" to be null.
>
>--
>Jacky Kwok
>jacky@alumni.cuhk.edu.hk
>jacky@compose.com.hk
>
>.
>Frank Guest
-
Kevin Spencer #5
Re: ASP.NET MailMessage in XP fails
The "Unable to relay" message would come if you used a server other than the
local machine, and that SMTP server disallows relaying. If you leave off the
SMTPServer property altogether, SMTPMail will use the local machine's SMTP
server by default. That's one way to make sure that the local machine's SMTP
server is used, and you shouldn't have any relaying issues in that case.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
[url]http://www.takempis.com[/url]
Complex things are made up of
lots of simple things.
"Frank" <ftozier@nc.rr.com> wrote in message
news:091f01c35693$814d8bb0$3501280a@phx.gbl...> Jacky -
>
> There is only one level of InnerException, "The server
> rejected one or more recipient addresses. The server
> response was: 550 5.7.1 Unable to relay for
> [email]ftozier@nc.rr.com[/email]".
>
> So my problem still is, why would the same code work from
> a Windows app on this same (XP Pro) machine, and from
> both Windows & asp.net on another machine?
>
> Thanks.
>
> Frank
>
>
>> anything> >-----Original Message-----
> >Frank wrote:> >> Ray - thanks for responding - but, no, setting the
> >> SmtpServer property to either "localhost" or another
> >> available (working) smtp server does not change> folders> >> for better or worse.
> >>
> >> I also made the ASPNET account (aspnet_wp, right?) an
> >> administrator. I've had some trouble before from> for> >> that didn't have web sharing turned on, so I did that> and> >> the mailroot and its subfolders - no change.
> >>
> >> The message, "Could not access 'CDO.Message' object",> on> >> the fact that mail works fine from Windows Forms apps> or> >> the same machine, makes it sound like it's an ASP.NET> today> >> IIS issue.
> >>
> >> There were also some Windows 2003 Server questions> (or> >> 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"> and> >>
> >> 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
> >>>ray@NOSPAM.greeble.com
> >>>(remove NOSPAM. from my e-mail address for a direct
> >>
> >> reply)
> >>
> >>>
> >>>"Frank" <ftozier@nc.rr.com> wrote in message
> >>>news:000601c355eb$b3d93d20$a401280a@phx.gbl.. .
> >>>
> >>>>Straightforward VB.NET 2002 code that works form both
> >>>>Windows and ASP.NET apps on a Windows 2000 machine,> any> >>>>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> the "InnerException" field of the> >> >>>>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.
> >>>
> >>>
> >>>.
> >>>
> >>
> >
> >Could you use a debugger to trace into> the "Could not access> >exception raised in send?
> >
> >In fact, the dotnet mail function just will throw> one in the> >'CDO.Message' object.", but the actual problem is the> the "InnerException" of the> >"InnerException". You may need to find> >"InnerException" until no deeper "InnerException".
> >
> >You can also change the code to make a loop to print the
> >"InnerException" until the "InnerException" to be null.
> >
> >--
> >Jacky Kwok
> >jacky@alumni.cuhk.edu.hk
> >jacky@compose.com.hk
> >
> >.
> >
Kevin Spencer Guest
-
Frank #6
Re: ASP.NET MailMessage in XP fails
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
folders>-----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 fromfor>that didn't have web sharing turned on, so I did thatand>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
>
>
>
>
>>whatever your SMTP>>-----Original Message-----
>>Hi Frank,
>>
>>Does setting the SmtpServer property to "localhost" (or>account's permissions on>>server is) fix it? If not, try checking the ASPNET>reply)>>the mailroot's folders.
>>
>>
>>--
>>Ray Dixon - Microsoft MVP
>>ray@NOSPAM.greeble.com
>>(remove NOSPAM. from my e-mail address for a direct>>
>>
>>"Frank" <ftozier@nc.rr.com> wrote in message
>>news:000601c355eb$b3d93d20$a401280a@phx.gbl...>>> Straightforward VB.NET 2002 code that works form both
>>> Windows and ASP.NET apps on a Windows 2000 machine,any>machine,>>> works in the Windows app on a newly installed XP>configuration>>> but fails in the ASP.NET code on XP. The unhandled
>>> exception is "COMException: The 'SendUsing'>>> 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>results.>>> of the 4 versions of the app does not change the>.>>>>> The smtp server is the local machine in all cases, and
>>> changing that does not change the results.
>>>
>>> I'd welcome any ideas.
>>>
>>> Thanks.
>>
>>.
>>
>Frank Guest
-
Yan-Hong Huang[MSFT] #7
Re: ASP.NET MailMessage in XP fails
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! - [url]www.microsoft.com/security[/url]
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!Content-Class: urn:content-classes:message
!From: "Frank" <ftozier@nc.rr.com>
!Sender: "Frank" <ftozier@nc.rr.com>
!References: <000601c355eb$b3d93d20$a401280a@phx.gbl> <uqb#DegVDHA.2248@TK2MSFTNGP10.phx.gbl>
<0a0701c3563e$60cec2f0$7d02280a@phx.gbl>
!Subject: Re: ASP.NET MailMessage in XP fails
!Date: Wed, 30 Jul 2003 11:20:32 -0700
!Lines: 110
!Message-ID: <09af01c356c7$4344d150$3501280a@phx.gbl>
!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
!>>ray@NOSPAM.greeble.com
!>>(remove NOSPAM. from my e-mail address for a direct
!>reply)
!>>
!>>
!>>"Frank" <ftozier@nc.rr.com> wrote in message
!>>news:000601c355eb$b3d93d20$a401280a@phx.gbl...
!>>> 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.
!>>
!>>
!>>.
!>>
!>.
!>
!
Yan-Hong Huang[MSFT] Guest



Reply With Quote

