.NETGURU
Problem sending smtp mail.
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-mail' list.


Karen Healey
Hello,

I'm working on a page that needs to send email and I'm at the point where I just want to test sending email to myself and I get an error, pasted below (scroll down).

If anybody has any ideas on this, please let me know. I've been poking around the documentation and can't come up with the answer yet. I SUSPECT it has something to do with the way my PC is set up for my broadband internet connection.

I did check IIS and that seems to be OK. I also put a text file with a test mail message in it in the C:\Inetpub\mailroot\Pickup and the message got sent.

My operating system is Windows XP Professional.

Here is the C# code I'm using which is almost straight from the documentation.
private void SubmitButton_Click(object sender, System.EventArgs e)

{

MailMessage myMail = new MailMessage();

myMail.From = "Click here to reveal e-mail address";

myMail.To = "Click here to reveal e-mail address";

myMail.Subject = "UtilMailMessage001";

myMail.Priority = MailPriority.Low;

myMail.BodyFormat = MailFormat.Html;

myMail.Body = "<html><body>UtilMailMessage001 - success</body></html>";

SmtpMail.Send(myMail);

}

Thanks,

Karen Healey
Click here to reveal e-mail address
(508)473-1218

Here is the error.......
Server Error in '/WebProject2' Application.
--------------------------------------------------------------------------------

The "SendUsing" configuration value is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

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

Source Error:

Line 112:            myMail.BodyFormat = MailFormat.Html;
Line 113:            myMail.Body = "<html><body>UtilMailMessage001 - success</body></html>";
Line 114:            SmtpMail.Send(myMail);
Line 115:        }
Line 116:    }

Source File: c:\inetpub\wwwroot\webproject2\webform1.aspx.cs Line: 114

Stack Trace:

[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) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1516
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
WebProject2.WebForm1.SubmitButton_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\webproject2\webform1.aspx.cs:114
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.0.3705.209; ASP.NET Version:1.0.3705.0
Reply to this message...
 
    
Brad Kingsley
Try adding ...
SmtpMail.SmtpServer = "localhost"
... as noted here: 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/
Windows 2000 Advanced Hosting
#1 in Service and Support

----- Original Message -----
From: "Karen Healey" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Thursday, April 11, 2002 10:36 AM
Subject: [ngfx-mail] Problem sending smtp mail.

> -- Moved from [aspngvb] to [ngfx-mail] by devin
<Click here to reveal e-mail address> --
[Original message clipped]

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

Reply to this message...
 
    
Gfw
Hello,

I'm working on a page that needs to send email and I'm at the point where I just want to test sending email to myself and I get an error, pasted below (scroll down).

If anybody has any ideas on this, please let me know. I've been poking
�round the documentation and can't come up with the answer yet. I SUSPECT it has something to do with the way my PC is set up for my broadband internet connection.

I did check IIS and that seems to be OK. I also put a text file with a
�est mail message in it in the C:\Inetpub\mailroot\Pickup and the message got sent.

My operating system is Windows XP Professional.

Here is the C# code I'm using which is almost straight from the documentation. private void SubmitButton_Click(object sender,
System.EventArgs e)

{

MailMessage myMail = new MailMessage();

myMail.From = "Click here to reveal e-mail address";

myMail.To = "Click here to reveal e-mail address";

myMail.Subject = "UtilMailMessage001";

myMail.Priority = MailPriority.Low;

myMail.BodyFormat = MailFormat.Html;

myMail.Body = "<html><body>UtilMailMessage001 - success
| [ngfx-mail] member Click here to reveal e-mail address �OUR ID
| http://www.aspfriends.com/aspfriends/ngfx-mail.asp �OIN/QUIT
</BODY></html>";

SmtpMail.Send(myMail);

}

Thanks,

Karen Healey
Click here to reveal e-mail address
(508)473-1218

Here is the error.......
Server Error in '/WebProject2' Application.
------------------------------------------------------------------------
--------

The "SendUsing" configuration value is invalid.
Description: An unhandled exception occurred during the execution of the
�urrent web request. Please review the stack trace for more
information �bout the error and where it originated in the code.

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

Source Error:

Line 112:            myMail.BodyFormat = MailFormat.Html;
Line 113:            myMail.Body "<html><body>UtilMailMessage001 - success
| [ngfx-mail] member Click here to reveal e-mail address �OUR ID
| http://www.aspfriends.com/aspfriends/ngfx-mail.asp �OIN/QUIT
</BODY></html>";
Line 114:            SmtpMail.Send(myMail);
Line 115:        }
Line 116:    }

Source File: c:\inetpub\wwwroot\webproject2\webform1.aspx.cs Line: 114

Stack Trace:

[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,
�inder 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) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1516
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
WebProject2.WebForm1.SubmitButton_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\webproject2\webform1.aspx.cs:114
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.Rai
sePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263

------------------------------------------------------------------------
--------

Version Information: Microsoft .NET Framework Version:1.0.3705.209; ASP.NET Version:1.0.3705.0
Reply to this message...
 
    
Karen Healey
A couple of people suggested the same thing so I tried this and got a
different error! There is nothing wrong with my email address.

This is fun...

Karen

Server Error in '/WebProject2' Application.
----------------------------------------------------------------------------
----

The server rejected one or more recipient addresses. The server response
was: 550 5.7.1 Unable to relay for Click here to reveal e-mail address
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The server
rejected one or more recipient addresses. The server response was: 550 5.7.1
Unable to relay for Click here to reveal e-mail address

Source Error:

Line 113:            myMail.Body = "<html><body>UtilMailMessage001 -
success</body></html>";
Line 114:            SmtpMail.SmtpServer = "localhost";
Line 115:            SmtpMail.Send(myMail);
Line 116:        }
Line 117:    }

Source File: c:\inetpub\wwwroot\webproject2\temp.aspx.cs Line: 115

Stack Trace:

[COMException (0x8004020f): The server rejected one or more recipient
addresses. The server response was: 550 5.7.1 Unable to relay for
Click here to reveal e-mail address
]

[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) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1516
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
WebProject2.WebForm1.SubmitButton_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\webproject2\temp.aspx.cs:115
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263

----------------------------------------------------------------------------
----

Version Information: Microsoft .NET Framework Version:1.0.3705.209; ASP.NET
Version:1.0.3705.0

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Thursday, April 11, 2002 11:16
Subject: [ngfx-mail] RE: Problem sending smtp mail.

[Original message clipped]

Reply to this message...
 
    
Brad Kingsley
Your local SMTP service is now allowing relay. You might want to tell it to
allow relay for 127.0.0.1

~Brad Kingsley
Microsoft MVP - ASP
Windows 2000 MCSE

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

----- Original Message -----
From: "Karen Healey" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Thursday, April 11, 2002 3:20 PM
Subject: [ngfx-mail] RE: Problem sending smtp mail.

[Original message clipped]

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

Reply to this message...
 
    
Karen Healey
That was it! Thank you! I was already going down that path (I had gotten
to the screen where you set it) but didn't know what IP address I should put
there.

Thank you!

Karen
----- Original Message -----
From: "Brad Kingsley" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Thursday, April 11, 2002 15:27
Subject: [ngfx-mail] RE: Problem sending smtp mail.

> Your local SMTP service is now allowing relay. You might want to tell it
to
[Original message clipped]

Reply to this message...
 
    
Guha, Rahul
Now you will have to take this up with your System Eng. Team because it
seems that the localserver ( the web server machine ) doesn't have
permission relaying the emails. This is a typical error ( I faced that ).
The only way out is finding a machine that has permission for relaying the
email. For more clarification you can visit MS newsgroup ( which was the
source of my info ).

-----Original Message-----
From: Karen Healey [mailto:Click here to reveal e-mail address]
Sent: Thursday, April 11, 2002 12:20 PM
To: ngfx-mail
Subject: [ngfx-mail] RE: Problem sending smtp mail.

A couple of people suggested the same thing so I tried this and got a
different error! There is nothing wrong with my email address.

This is fun...

Karen

Server Error in '/WebProject2' Application.
----------------------------------------------------------------------------
----

The server rejected one or more recipient addresses. The server response
was: 550 5.7.1 Unable to relay for Click here to reveal e-mail address
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The server
rejected one or more recipient addresses. The server response was: 550 5.7.1
Unable to relay for Click here to reveal e-mail address

Source Error:

Line 113: myMail.Body =
"<html><body>UtilMailMessage001 -
success
| [ngfx-mail] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-mail.asp = JOIN/QUIT
</BODY></html>";
Line 114: SmtpMail.SmtpServer = "localhost";
Line 115: SmtpMail.Send(myMail);
Line 116: }
Line 117: }

Source File: c:\inetpub\wwwroot\webproject2\temp.aspx.cs Line: 115

Stack Trace:

[COMException (0x8004020f): The server rejected one or more recipient
addresses. The server response was: 550 5.7.1 Unable to relay for
Click here to reveal e-mail address
]

[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) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1516
System.Web.Mail.SmtpMail.Send(MailMessage message) +49
WebProject2.WebForm1.SubmitButton_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\webproject2\temp.aspx.cs:115
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263

----------------------------------------------------------------------------
----

Version Information: Microsoft .NET Framework Version:1.0.3705.209; ASP.NET
Version:1.0.3705.0

----- Original Message -----
From: "Gfw" <Click here to reveal e-mail address>
To: "ngfx-mail" <Click here to reveal e-mail address>
Sent: Thursday, April 11, 2002 11:16
Subject: [ngfx-mail] RE: Problem sending smtp mail.

[Original message clipped]

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

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

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

Reply to this message...
 
 
System.Collections.Specialized.NameValueCollection
System.EventArgs
System.Globalization.CultureInfo
System.Reflection.BindingFlags
System.Reflection.ParameterModifier
System.Reflection.TargetInvocationException
System.Runtime.InteropServices.COMException
System.Web.HttpApplication
System.Web.HttpContext
System.Web.HttpException
System.Web.HttpUnhandledException
System.Web.Mail.MailFormat
System.Web.Mail.MailMessage
System.Web.Mail.MailPriority
System.Web.Mail.SmtpMail
System.Web.UI.IPostBackEventHandler
System.Web.UI.Page
System.Web.UI.WebControls.Button




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