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:
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
Dim smtp As New System.Net.Mail.SmtpClient()
Dim smail As New System.Net.Mail.MailMessage
smail.To.Add(New System.Net.Mail.MailAddress("emailtowhomyouwanttosend@yahoo.com "))
smail.From = New System.Net.Mail.MailAddress("youremail@gmail.com", "Visit me")
smail.Subject = "hiii"
smail.IsBodyHtml = "true"
smail.Body = "HELLO THERE"
smtp.EnableSsl = True
smtp.Send(smail)
It seems that there is problem in your relay server configuration use the correct network credentials . use the gmail account for sending email and use the above Provided code for sending email.
one thing more System.Mail.smtpMail is obselete in .net 2.0 use the System.Net.SmtpClient name space .
Best Regards
Rameez
life is name of learning!
Mark as an answer if it helps
MailMessage mail = new MailMessage();
string to, from;
to = "mymail@gmail.com";
from = "mymail@gmail.com";
mail.To.Add(to);
mail.From = new MailAddress(from);
mail.Subject = "yahoo";
mail.Body = "hello, this is test mail";
mail.IsBodyHtml = true;
System.Net.NetworkCredential acred = new System.Net.NetworkCredential("mymail@gmail.com", "password"); //give a user name and password for authentication on server
SmtpClient client = new SmtpClient("smtp.gmail.com", 465); //give your smtp server name/ip address here
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = acred;
client.Send(mail);
}
please note, i have a working gmail account, dont have any firewalls not even windows one, ... every thing works but when
this button is clicked, firefox keeps on going for a few minutes then it comes
PLEASE BE CLEAR IN UR EXPLANATION I AM A NEW BEE THNKU
Server Error in '/01 project NED1' Application.
The operation has timed out.
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.SmtpException: The operation has timed out.
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.
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
CANT I JUST SEND EMAIL TO A ACCOUNT BY USING PURE CODE,
tht is why do i have to give email and password of my account,
i dont want to access it i just want to snd a mail from the comp i using to a account say private or gmail.
None
0 Points
44 Posts
Problem in sending mail
Oct 21, 2008 06:40 AM|sitaramnayak|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:
Participant
1092 Points
302 Posts
Re: Problem in sending mail
Oct 21, 2008 07:32 AM|Ramkumar.Venkatachalam|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.
Member
322 Points
156 Posts
Re: Problem in sending mail
Oct 21, 2008 07:53 AM|Jagadeesh Jupalli|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
Participant
912 Points
294 Posts
Re: Problem in sending mail
Oct 21, 2008 08:00 AM|Priyasadiwala|LINK
hi,
instead of "'MailObj.Send(msg) "
write "SmtpMail.Send(msg);" and see . will it works.
Priya
All-Star
26104 Points
5595 Posts
Re: Problem in sending mail
Oct 21, 2008 03:07 PM|Haissam|LINK
Check below link
http://www.systemnetmail.com/
MCAD.NET
| Blog |
Member
501 Points
184 Posts
Re: Problem in sending mail
Oct 21, 2008 03:19 PM|Agapito|LINK
You need to authenticate on the server.
If you MailObj is a SmtpClientyou are missing this:
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.
None
0 Points
44 Posts
Re: Problem in sending mail
Oct 22, 2008 12:55 AM|sitaramnayak|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
None
0 Points
44 Posts
Re: Problem in sending mail
Oct 22, 2008 12:56 AM|sitaramnayak|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:
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:
Version Information: Microsoft .NET Framework V
Member
360 Points
122 Posts
Re: Problem in sending mail
Oct 22, 2008 01:16 AM|kdevendra|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
None
0 Points
44 Posts
Re: Problem in sending mail
Oct 22, 2008 01:29 AM|sitaramnayak|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.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)
Member
501 Points
184 Posts
Re: Problem in sending mail
Oct 22, 2008 05:56 AM|Agapito|LINK
I hope this is not the real credentials
New Net.NetworkCredential("admin@fodra.org.in", "fodra-3")
If it is.... Change them because now we know it! :P
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.
Star
9691 Points
2187 Posts
Re: Problem in sending mail
Oct 22, 2008 07:00 AM|yasserzaid|LINK
Hi
copy the following code.. its working for my gmail account
in web.config
<system.net>
<mailSettings>
<smtp from="youremail@gmail.com">
<network host="smtp.gmail.com" port="587" userName="youremail" password="xx" defaultCredentials="false"/>
</smtp>
</mailSettings>
</system.net>
In code behind ( on button click)
Dim smtp As New System.Net.Mail.SmtpClient()
Dim smail As New System.Net.Mail.MailMessage
smail.To.Add(New System.Net.Mail.MailAddress("emailtowhomyouwanttosend@yahoo.com "))
smail.From = New System.Net.Mail.MailAddress("youremail@gmail.com", "Visit me")
smail.Subject = "hiii"
smail.IsBodyHtml = "true"
smail.Body = "HELLO THERE"
smtp.EnableSsl = True
smtp.Send(smail)
It will work for sure..
Good Luck
Contributor
2635 Points
1784 Posts
Re: Problem in sending mail
Dec 27, 2008 02:27 AM|Rameezwaheed|LINK
Hi,
It seems that there is problem in your relay server configuration use the correct network credentials . use the gmail account for sending email and use the above Provided code for sending email.
one thing more System.Mail.smtpMail is obselete in .net 2.0 use the System.Net.SmtpClient name space .
Best Regards
Rameez
Mark as an answer if it helps
Member
54 Points
173 Posts
Re: Problem in sending mail
Apr 22, 2009 05:24 PM|nwallaq|LINK
protected void Button2_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
string to, from;
to = "mymail@gmail.com";
from = "mymail@gmail.com";
mail.To.Add(to);
mail.From = new MailAddress(from);
mail.Subject = "yahoo";
mail.Body = "hello, this is test mail";
mail.IsBodyHtml = true;
System.Net.NetworkCredential acred = new System.Net.NetworkCredential("mymail@gmail.com", "password"); //give a user name and password for authentication on server
SmtpClient client = new SmtpClient("smtp.gmail.com", 465); //give your smtp server name/ip address here
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = acred;
client.Send(mail);
}
please note, i have a working gmail account, dont have any firewalls not even windows one, ... every thing works but when
this button is clicked, firefox keeps on going for a few minutes then it comes
PLEASE BE CLEAR IN UR EXPLANATION I AM A NEW BEE THNKU
Server Error in '/01 project NED1' Application.
The operation has timed out.
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.SmtpException: The operation has timed out.
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:
[SmtpException: The operation has timed out.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +1426
Default2.Button2_Click(Object sender, EventArgs e) +214
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
CANT I JUST SEND EMAIL TO A ACCOUNT BY USING PURE CODE,
tht is why do i have to give email and password of my account,
i dont want to access it i just want to snd a mail from the comp i using to a account say private or gmail.