when click send button it shows below error message please help me
Server Error in '/mail' Application.
Mailbox unavailable. The server response was: Authentication is required for relay
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.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: Authentication is required for relay
Source Error:
The source code that generated this unhandled exception can only be
shown when compiled in debug mode. To enable this, please follow one of
the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given
application to be compiled in debug mode. The first technique will
cause only that particular file to be compiled in debug mode.
Important:
Running applications in debug mode does incur a memory/performance
overhead. You should make sure that an application has debugging
disabled before deploying into production scenario.
hi this is giving below error Server Error in '/mail' 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: The source code that generated this unhandled exception can only be shown when
compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: 1. Add a "Debug=true" directive at the top of the file that generated the error. Example: or: 2) Add the following section to the configuration file of your
application: Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode. Important: Running applications in debug mode
does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. 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 bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +436 System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
+72 [HttpException (0x80004005): The "SendUsing" configuration value is invalid. ] System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +119 System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1955 System.Web.Mail.SmtpMail.Send(MailMessage
message) +131 _Default.Button1_Click(Object sender, EventArgs e) +96 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +1746 Version Information: Microsoft .NET Framework V
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:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
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 bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +436
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +72
[HttpException (0x80004005): The "SendUsing" configuration value is invalid.
]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +119
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1955
System.Web.Mail.SmtpMail.Send(MailMessage message) +131
_Default.Button1_Click(Object sender, EventArgs e) +96
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
sitaramnayak
Member
20 Points
46 Posts
Problem in sending mail
Oct 21, 2008 10:40 AM|LINK
Hi i have written a prog to send a mail the programe as follows
Dim msg As MailMessage = New MailMessage()
'Dim MailObj As New SmtpClient("mail.fodra.org.in")
'msg.From = New MailAddress("admin@fodra.org.in")
'msg.To.Add(New MailAddress("sitaramnayak@yahoo.co.in"))
'msg.Subject = "sitaram Test"
'msg.Priority = MailPriority.High
'msg.IsBodyHtml = True
'msg.Body = "Mail Test"
'MailObj.Send(msg)
Above i have given my hosting address or mail
when click send button it shows below error message please help me
Server Error in '/mail' Application.
Mailbox unavailable. The server response was: Authentication is required for relay
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.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: Authentication is required for relay
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: 1. Add a "Debug=true" directive at the top of the file that generated the error. Example: <%@ Page Language="C#" Debug="true" %> or: 2) Add the following section to the configuration file of your application: <configuration> <system.web> <compilation debug="true"/> </system.web> </configuration> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode. Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.Stack Trace:
Ramkumar.Ven...
Participant
1666 Points
305 Posts
Re: Problem in sending mail
Oct 21, 2008 11:32 AM|LINK
Hi Dude,
Try this out....
System.Web.Mail.MailMessage objMail = new System.Web.Mail.MailMessage();
objMail.BodyFormat = System.Web.Mail.MailFormat.Html;
objMail.From = "admin@fodra.org.in";
objMail.To = "";
objMail.Subject = "test";
objMail.Priority = System.Web.Mail.MailPriority.High;
string l_body;
l_body="Test";
objMail.Body = l_body;
System.Web.Mail.SmtpMail.Send(objMail);
Ramkumar.V
Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
Jagadeesh Ju...
Member
490 Points
157 Posts
Re: Problem in sending mail
Oct 21, 2008 11:53 AM|LINK
Hi,
This is the C# code to send emails in HTML format.
MailAddress SendFrom = new MailAddress(txtFrom.Text);
MailAddress SendTo = new MailAddress(txtTo.Text);
MailMessage MyMessage = new MailMessage(SendFrom, SendTo);
MyMessage.Subject = "Subject here";
MyMessage.IsBodyHtml = true;
MyMessage.Priority = MailPriority.Normal;
MyMessage.Body = "Some Html Body here";
SmtpClient emailClient = new SmtpClient();
emailClient.UseDefaultCredentials = true;
emailClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
emailClient.Host = "localhost";
emailClient.Send(MyMessage);
~Jagadeesh
Online Live TV Channels, Radio's and WebCams
Priyasadiwal...
Participant
1443 Points
295 Posts
Re: Problem in sending mail
Oct 21, 2008 12:00 PM|LINK
hi,
instead of "'MailObj.Send(msg) "
write "SmtpMail.Send(msg);" and see . will it works.
Priya
Haissam
All-Star
37421 Points
5632 Posts
Re: Problem in sending mail
Oct 21, 2008 07:07 PM|LINK
Check below link
http://www.systemnetmail.com/
MCAD.NET
| Blog |
Agapito
Participant
852 Points
187 Posts
Re: Problem in sending mail
Oct 21, 2008 07:19 PM|LINK
You need to authenticate on the server.
If you MailObj is a SmtpClientyou are missing this:
MailObj.Credentials = new NetworkCredential("username", "password");
www.infortucano.pt
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
sitaramnayak
Member
20 Points
46 Posts
Re: Problem in sending mail
Oct 22, 2008 04:55 AM|LINK
hi this is giving below error Server Error in '/mail' 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: The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: 1. Add a "Debug=true" directive at the top of the file that generated the error. Example: or: 2) Add the following section to the configuration file of your application: Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode. Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. 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 bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +436 System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +72 [HttpException (0x80004005): The "SendUsing" configuration value is invalid. ] System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +119 System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1955 System.Web.Mail.SmtpMail.Send(MailMessage message) +131 _Default.Button1_Click(Object sender, EventArgs e) +96 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746 Version Information: Microsoft .NET Framework V
sitaramnayak
Member
20 Points
46 Posts
Re: Problem in sending mail
Oct 22, 2008 04:56 AM|LINK
hi this is giving below error message
Server Error in '/mail' 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:
Stack Trace:
Version Information: Microsoft .NET Framework V
kdevendra
Member
594 Points
123 Posts
Re: Problem in sending mail
Oct 22, 2008 05:16 AM|LINK
Hi,
give a smtp server name with network credentials.
try following code:
use following code to send mail using system.net.mail;
MailMessage mail= new MailMessage();
mail.To.Add(receiver1@externaldomain.com); //add receiver's email address here
mail.To.Add(receiver2@externaldomain2.com);
mail.From=new MailMessage(sender@domain.com);
mail.Subject="Subject";
mail.Body="hello, this is test mail";
mail.IsBodyHtml=true;
SmtpClient client= new SmtpClient("smtp.example.com"); //give your smtp server name/ip address here
client.Credentials=new NetworkCredential(test@example.com, "password"); //give a user name and password for authentication on server
client.Send(mail);
Powered by CTRL+C, Driven by CTRL+V
sitaramnayak
Member
20 Points
46 Posts
Re: Problem in sending mail
Oct 22, 2008 05:29 AM|LINK
Thanks yar it is working
i have modified it for vb like this
Dim mail As New MailMessage()mail.To.Add("sitaramnayak@yahoo.co.in")
mail.From = New MailAddress("admin@fodra.org.in")mail.Subject =
"Subject"mail.Body =
"hello, this is test mail"mail.IsBodyHtml =
True Dim client As New SmtpClient("mail.fodra.org.in")client.Credentials =
New Net.NetworkCredential("admin@fodra.org.in", "fodra-3")client.Send(mail)