Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal!
To com uma pequena dificuldade no envio de e-mails usando ASP.net . Toda vez que tento enviar um e-mail dá o seguinte erro :
************
Bad sequence of commands. The server response was: Send quota has been exceeded (#5.5.1)
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: Bad sequence of commands. The server response was: Send quota has been exceeded (#5.5.1)
Source Error:
Line 57: SmtpClient oEnviar = new SmtpClient();
Line 58: oEnviar.Host = "mail-nt.braslink.com";
Line 59: oEnviar.Send(oEmail);
Line 60: oEmail.Dispose();
Line 61:
Source File: d:\www\santannaconsultoria.com.br\www\versao4\contato.aspx.cs Line: 59
Stack Trace:
[smtpException: Bad sequence of commands. The server response was: Send quota has been exceeded (#5.5.1)]
System.Net.Mail.DataCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse) +848824
System.Net.Mail.DataCommand.Send(SmtpConnection conn) +35
System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) +609
System.Net.Mail.SmtpClient.Send(MailMessage message) +2004
contato.btEnviar_Click(Object sender, EventArgs e) in d:\www\santannaconsultoria.com.br\www\versao4\contato.aspx.cs:59
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.RaisePostBa
kEvent(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) +5102
***********
Não consigo entender porque, pelo o que percebi é como se o e-mail que estou enviando fosse grande demais, e não é!
estou usando esse código:
>
protected void btEnviar_Click(object sender, EventArgs e)
{
if (TextNome.Text == "")
{
LabelErro.Text = "Por favor informe seu nome!";
TextNome.Focus();
}
else if (TextEmpresa.Text == "")
{
LabelErro.Text = "Por favor informe o nome de sua empresa!";
TextEmpresa.Focus();
}
else if (TextTel.Text == "")
{
LabelErro.Text = "Por favor informe seu telefone!";
TextTel.Focus();
}
else if (TextEmail.Text == "")
{
LabelErro.Text = "Por favor informe seu e-mail!";
TextEmail.Focus();
}
else if (TextMsg.Text == "")
{
LabelErro.Text = "Por favor escreva sua mensagem!";
TextMsg.Focus();
}
else
{
MailMessage oEmail = new MailMessage();
MailAddress sDe = new MailAddress(TextEmail.Text);
oEmail.To.Add("vinisantanna@hotmail.com");
oEmail.From = sDe ;
oEmail.Priority = MailPriority.Normal;
oEmail.IsBodyHtml = false;
oEmail.Subject = TextEmpresa.Text;
oEmail.Body = "Nome do contato:" + TextNome.Text + '\n'+ "Empresa:" + TextEmpresa.Text + '\n' + "Telefone:" + TextTel.Text + '\n' + "E-mail:" + TextEmail.Text + '\n' + "IP Contato:" + Request.UserHostAddress + '\n' + '\n' + TextMsg.Text;
SmtpClient oEnviar = new SmtpClient();
oEnviar.Host = "mail-nt.braslink.com";
oEnviar.Send(oEmail);
oEmail.Dispose();
TextEmail.Text = "";
TextEmpresa.Text = "";
TextMsg.Text = "";
TextNome.Text ="";
TextTel.Text = "";
LabelErro.Text = "Obrigado, seu e-mail foi enviado com sucesso!";
}
}
espero que alguem possa me ajudar... xD
Carregando comentários...