.NETGURU
SmtpMail.Send exception
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-mail' list.


Howard Cheng
-- Moved from [aspngfreeforall] to [ngfx-mail] by Douglas Reilly <Click here to reveal e-mail address> --

Hello,

I'm getting the following error when trying to send mail. The SMTP server
is properly running and I'm able to send email from classic ASP sites on
the same server via the CDONTS.NewMail object.

System.Runtime.InteropServices.COMException: The "SendUsing" configuration
value is invalid.

Here's the stack trace, if it helps:

[COMException (0x80040220): The "SendUsing" configuration value is invalid. ]

[TargetInvocationException: Exception has been thrown by the target of an
invocation.] System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32
culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +111
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1516
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
CitationShares.Tools.EmailThisPage.Submit_Clicked(Object sender,
ImageClickEventArgs e) in C:\Documents and
Settings\hcheng\VSWebCache\citationshares.zentropy.com\tools\popups\email_page.aspx.cs:67

System.Web.UI.HtmlControls.HtmlInputImage.OnServerClick(ImageClickEventArgs
e) +109
System.Web.UI.HtmlControls.HtmlInputImage.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +67
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263

Of course, our sysadmin is out on vacation right now, too. Any pointers
would be greatly appreciated. Thanks.

::::::::::::::::::::::
Howard Cheng
Click here to reveal e-mail address
AIM: bennyphoebe
ICQ: 47319315

Reply to this message...
 
    
aspNetEmail
Can you post your code?

Thanks,
www.aspNetEmail.com

----- Original Message -----
From: "Howard Cheng" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Friday, May 03, 2002 6:21 PM
Subject: [ngfx-mail] SmtpMail.Send exception

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

ge.aspx.cs:67
[Original message clipped]

r.RaisePostBackEvent(String
[Original message clipped]

Reply to this message...
 
    
Brad Kingsley
Check out the sample code at this link - it should work "as is".

http://www.orcsweb.com/articles/emailasp.asp" target="_blank">http://www.orcsweb.com/articles/emailasp.asp

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Powerful Web Hosting Solutions
#1 in Service and Support

----- Original Message -----
From: "Howard Cheng" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Friday, May 03, 2002 7:21 PM
Subject: [ngfx-mail] SmtpMail.Send exception

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

ge.aspx.cs:67
[Original message clipped]

r.RaisePostBackEvent(String
[Original message clipped]

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

Reply to this message...
 
    
Howard Cheng
OK, the only thing I was missing in my own code was setting the SmtpServer
to localhost, so after doing that I get:

System.Runtime.InteropServices.COMException: The server rejected one or
more recipient addresses. The server response was: 550 5.7.1 Unable to
relay for ...

FYI the email address is valid and again, it works from "classic" ASP web
apps on the same server. No matter what address I put in there, I still get
the same error.

Any clues? Here's the code for reference.

MailMessage msg = new MailMessage();
msg.Subject = "CitationShares";
msg.To = emailToInput;
msg.From = emailFromInput;
if (emailCopyChecked) msg.Cc = emailFromInput;
msg.Body = emailMsgInput;
msg.BodyEncoding = Encoding.ASCII;

SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(msg);

Thanks.

At 08:35 AM 5/4/2002 -0400, Brad Kingsley wrote:
[Original message clipped]

::::::::::::::::::::::
Howard Cheng
Click here to reveal e-mail address
AIM: bennyphoebe
ICQ: 47319315

Reply to this message...
 
    
Brad Kingsley
Set your SMTP service to allow relay for 127.0.0.1

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

http://www.orcsweb.com/
Powerful Web Hosting Solutions
#1 in Service and Support

----- Original Message -----
From: "Howard Cheng" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Monday, May 06, 2002 1:43 PM
Subject: [ngfx-mail] Re: SmtpMail.Send exception

[Original message clipped]

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

Reply to this message...
 
    
gordon
Q2hlY2sgb3V0IGh0dHA6Ly9kbi55eXl6Lm5ldC9Ebll6QXJ0aWNsZVNob3cuYXNweD9XQT0yMg0K
IA0KVXNlIHRoZSBTTVRQIG1haWwgbGluayBvbiB0aGUgcGFnZS4NCiANCkdmdw0KR2Z3QHl5eVou
TmV0DQpodHRwOi8vRG4ueXl5Wi5OZXQNCiANCg0KCS0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0t
IA0KCUZyb206IEhvd2FyZCBDaGVuZyBbbWFpbHRvOmhvd2NoZW5nQGl4Lm5ldGNvbS5jb21dIA0K
CVNlbnQ6IE1vbiA1LzYvMjAwMiAxMjo0MyBQTSANCglUbzogbmdmeC1tYWlsIA0KCUNjOiANCglT
dWJqZWN0OiBbbmdmeC1tYWlsXSBSZTogU210cE1haWwuU2VuZCBleGNlcHRpb24NCgkNCgkNCg0K
CU9LLCB0aGUgb25seSB0aGluZyBJIHdhcyBtaXNzaW5nIGluIG15IG93biBjb2RlIHdhcyBzZXR0
aW5nIHRoZSBTbXRwU2VydmVyDQoJdG8gbG9jYWxob3N0LCBzbyBhZnRlciBkb2luZyB0aGF0IEkg
Z2V0Og0KCQ0KCVN5c3RlbS5SdW50aW1lLkludG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W5rIC0gaXQgc2hvdWxkIHdvcmsgImFzIGlzIi4NCgk+DQoJPmh0dHA6Ly93d3cub3Jj
c3dlYi5jb20vYXJ0aWNsZXMvZW1haWxhc3AuYXNwDQoJDQoJOjo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6
Og0KCUhvd2FyZCBDaGVuZw0KCWhvd2NoZW5nQGl4Lm5ldGNvbS5jb20NCglBSU06IGJlbm55cGhv
ZWJlDQoJSUNROiA0NzMxOTMxNQ0KCQ0KCQ0KCXwgW25nZngtbWFpbF0gbWVtYmVyIGdmd0B5eXl6
Lm5ldCA9IFlPVVIgSUQNCgl8IGh0dHA6Ly93d3cuYXNwZnJpZW5kcy5jb20vYXNwZnJpZW5kcy9u
Z2Z4LW1haWwuYXNwID0gSk9JTi9RVUlUDQoJDQoNCg=
Reply to this message...
 
 
System.Collections.Specialized.NameValueCollection
System.Globalization.CultureInfo
System.Reflection.BindingFlags
System.Reflection.ParameterModifier
System.Reflection.TargetInvocationException
System.Runtime.InteropServices.COMException
System.Text.Encoding
System.Web.HttpException
System.Web.Mail.MailMessage
System.Web.Mail.SmtpMail
System.Web.UI.HtmlControls.HtmlInputImage
System.Web.UI.ImageClickEventArgs
System.Web.UI.IPostBackEventHandler
System.Web.UI.Page




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