.NETGURU
SMTP Mail
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-mail' list.


Gfw
I have the same code on two servers running ASP.Net V1.0 - as far as I
can tell, the properties of both SMTP servers are set the same and both
have been started - on one server, the mail message gets sent without
problem. On the other server, I get the following error message:

Error in SendMail: 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 (0x80040220): The
"SendUsing" configuration value is invalid. --- 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
DnYZNet.DnYzEmail.SendMail()

Any help appreciated. Thanks.

Gfw
Reply to this message...
 
    
Brad Kingsley
What's the code look like?

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Windows 2000 Advanced Hosting
#1 in Service and Support

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Saturday, March 23, 2002 7:15 AM
Subject: [ngfx-mail] SMTP Mail

> -- Moved from [aspngfreeforall] to [ngfx-mail] by Marcie Jones
<Click here to reveal e-mail address> --
[Original message clipped]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Gfw
            try
            {
                MailMessage Mailer = new MailMessage();
                Mailer.Priority =
System.Web.Mail.MailPriority.High;
                Mailer.To = m_eTo;
                Mailer.Bcc = "Click here to reveal e-mail address";
                Mailer.From = m_eFrom;
                Mailer.Subject = m_eSubject;
                Mailer.Body     = m_eMessage;

                if (m_Type==0) Mailer.BodyFormat =
System.Web.Mail.MailFormat.Html;
                else Mailer.BodyFormat =
System.Web.Mail.MailFormat.Text;

                if (m_eAttachment!=null)
                    Mailer.Attachments.Add(new
MailAttachment(m_eAttachment));

                SmtpMail.Send(Mailer);
                lblResult.Text = "Page Sent!";
            }
            catch(Exception ex)
            {
                lblResult.Text = "Error in SendMail: " +
ex.ToString();
            }

Gfw
mailto:Click here to reveal e-mail address
http://yyyZ.Net

-----Original Message-----
From: Brad Kingsley [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 8:23 AM
To: ngfx-mail
Subject: [ngfx-mail] Re: SMTP Mail

What's the code look like?

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Windows 2000 Advanced Hosting
#1 in Service and Support

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Saturday, March 23, 2002 7:15 AM
Subject: [ngfx-mail] SMTP Mail

> -- Moved from [aspngfreeforall] to [ngfx-mail] by Marcie Jones
<Click here to reveal e-mail address> --
[Original message clipped]

| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Brad Kingsley
Try adding...

SmtpMail.SmtpServer = "localhost";

...just before the Send() method.

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Windows 2000 Advanced Hosting
#1 in Service and Support

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Saturday, March 23, 2002 9:26 AM
Subject: [ngfx-mail] Re: SMTP Mail

[Original message clipped]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Gfw
Still get the same message - with the code added it also failed on my
local machine.

Gfw
mailto:Click here to reveal e-mail address
http://yyyZ.Net

-----Original Message-----
From: Brad Kingsley [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 8:39 AM
To: ngfx-mail
Subject: [ngfx-mail] Re: SMTP Mail

Try adding...

SmtpMail.SmtpServer = "localhost";

...just before the Send() method.

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Windows 2000 Advanced Hosting
#1 in Service and Support

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Saturday, March 23, 2002 9:26 AM
Subject: [ngfx-mail] Re: SMTP Mail

[Original message clipped]

| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
G. Andrew Duthie
The message "The "SendUsing" configuration value is invalid." usually
indicates that you have not set the SmtpMail.SmtpServer property in your
code, which is required for RTM. If you wish to send mail using the
local server, you can simply set it to "localhost":

SmtpMail.SmtpServer =3D "localhost"
SmtpMail.Send(MyMail)

hth,

--
G. Andrew Duthie
Graymad Enterprises, Inc.
http://www.graymad.com
Click here to reveal e-mail address
Author, Microsoft ASP.NET Step By Step
http://www.amazon.com/exec/obidos/ASIN/0735612870/

[Original message clipped]

Reply to this message...
 
    
Gfw
Thanks. That's also what Brad K. suggested - still failed.

Gfw
mailto:Click here to reveal e-mail address
http://yyyZ.Net

-----Original Message-----
From: G. Andrew Duthie [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 8:54 AM
To: ngfx-mail
Subject: [ngfx-mail] RE: SMTP Mail

The message "The "SendUsing" configuration value is invalid." usually
indicates that you have not set the SmtpMail.SmtpServer property in your
code, which is required for RTM. If you wish to send mail using the
local server, you can simply set it to "localhost":

SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(MyMail)

hth,

--
G. Andrew Duthie
Graymad Enterprises, Inc.
http://www.graymad.com
Click here to reveal e-mail address
Author, Microsoft ASP.NET Step By Step
http://www.amazon.com/exec/obidos/ASIN/0735612870/

[Original message clipped]

| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

Reply to this message...
 
    
Brad Kingsley
Are you sure the SMTP service is running correctly on each machine?

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Windows 2000 Advanced Hosting
#1 in Service and Support

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Saturday, March 23, 2002 9:58 AM
Subject: [ngfx-mail] RE: SMTP Mail

[Original message clipped]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Gfw
It says that it's running - I've been using term Server to access and I
think it's time to actually go take a look at the machine. It worked
perfectly up until about 1-2 days ago - as far as I know nothing changed
on the machine - but then something must have.

Gfw
mailto:Click here to reveal e-mail address
http://yyyZ.Net

-----Original Message-----
From: Brad Kingsley [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 9:12 AM
To: ngfx-mail
Subject: [ngfx-mail] RE: SMTP Mail

Are you sure the SMTP service is running correctly on each machine?

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Windows 2000 Advanced Hosting
#1 in Service and Support

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Saturday, March 23, 2002 9:58 AM
Subject: [ngfx-mail] RE: SMTP Mail

[Original message clipped]

| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Gfw
It was indeed a configuration problem - Steve of AspFree logged on -
changed a few settings - and all started working again. Thanks for all
the help.

Gfw
mailto:Click here to reveal e-mail address
http://yyyZ.Net

-----Original Message-----
From: Gfw [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 9:18 AM
To: ngfx-mail
Subject: [ngfx-mail] RE: SMTP Mail

It says that it's running - I've been using term Server to access and I
think it's time to actually go take a look at the machine. It worked
perfectly up until about 1-2 days ago - as far as I know nothing changed
on the machine - but then something must have.

Gfw
mailto:Click here to reveal e-mail address
http://yyyZ.Net

-----Original Message-----
From: Brad Kingsley [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 9:12 AM
To: ngfx-mail
Subject: [ngfx-mail] RE: SMTP Mail

Are you sure the SMTP service is running correctly on each machine?

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Windows 2000 Advanced Hosting
#1 in Service and Support

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Saturday, March 23, 2002 9:58 AM
Subject: [ngfx-mail] RE: SMTP Mail

[Original message clipped]

| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT

| [ngfx-mail] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
G. Andrew Duthie
It would be helpful for others, and for the archives, if you or Steve
could send mail to the list outlining the steps that were taken to fix
the configuration.

Regards,

--
G. Andrew Duthie
Graymad Enterprises, Inc.
http://www.graymad.com
Click here to reveal e-mail address
Author, Microsoft ASP.NET Step By Step
http://www.amazon.com/exec/obidos/ASIN/0735612870/

[Original message clipped]

Reply to this message...
 
    
Gfw
Under the properties of the SMTP Server, Steve...
1) Selected the Access Tab
2) Selected Relay Button
3) Added local computer 127.0.0.1 to the authorized list
4) Unchecked the "Allow All Computers"

The really interesting thing is that the changes fixed the problem on
Server #2.

Server #1 still has the original settings (no computers added and the
Allow All Computers is still checked) and the SMTP Server works fine.
Interesting.

Gfw
mailto:Click here to reveal e-mail address
http://yyyZ.Net

-----Original Message-----
From: G. Andrew Duthie [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 9:59 AM
To: ngfx-mail
Subject: [ngfx-mail] RE: SMTP Mail

It would be helpful for others, and for the archives, if you or Steve
could send mail to the list outlining the steps that were taken to fix
the configuration.

Regards,

--
G. Andrew Duthie
Graymad Enterprises, Inc.
http://www.graymad.com
Click here to reveal e-mail address
Author, Microsoft ASP.NET Step By Step
http://www.amazon.com/exec/obidos/ASIN/0735612870/

[Original message clipped]

| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

Reply to this message...
 
    
Guha, Rahul

I had similar problem before. You gotta make sure that the smtpServer has
permission to relay emails.

-----Original Message-----
From: Gfw [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 6:59 AM
To: ngfx-mail
Subject: [ngfx-mail] RE: SMTP Mail

Thanks. That's also what Brad K. suggested - still failed.

Gfw
mailto:Click here to reveal e-mail address
http://yyyZ.Net

-----Original Message-----
From: G. Andrew Duthie [mailto:Click here to reveal e-mail address]
Sent: Saturday, March 23, 2002 8:54 AM
To: ngfx-mail
Subject: [ngfx-mail] RE: SMTP Mail

The message "The "SendUsing" configuration value is invalid." usually
indicates that you have not set the SmtpMail.SmtpServer property in your
code, which is required for RTM. If you wish to send mail using the
local server, you can simply set it to "localhost":

SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(MyMail)

hth,

--
G. Andrew Duthie
Graymad Enterprises, Inc.
http://www.graymad.com
Click here to reveal e-mail address
Author, Microsoft ASP.NET Step By Step
http://www.amazon.com/exec/obidos/ASIN/0735612870/

[Original message clipped]

| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT

| [ngfx-mail] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT
</BODY></HTML>
[Original message clipped]

Reply to this message...
 
 
System.Globalization.CultureInfo
System.Reflection.BindingFlags
System.Reflection.ParameterModifier
System.Reflection.TargetInvocationException
System.Runtime.InteropServices.COMException
System.Web.HttpException
System.Web.Mail.MailAttachment
System.Web.Mail.MailFormat
System.Web.Mail.MailMessage
System.Web.Mail.MailPriority
System.Web.Mail.SmtpMail




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification