Hi everyone
I have following error while sending mail.
System.Net.Mail.SmtpException: Syntax error, command unrecognized. The server response was: your host [117.198.80.98] is blacklisted by xbl.dnsbl. Send your questions to blacklist-admin@mail4.easycgi.com at System.Net.Mail.RecipientCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.RecipientCommand.Send(SmtpConnection conn, String to, String& response) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at search.ImageButton1_Click(Object sender, ImageClickEventArgs e)
can anyone help me how to remove this error? Thanks in advance.
|
| Author: shanmukha kumari 27 Jul 2008 | Member Level: Gold | Rating:  Points: 2 |
see the below link. You will get some solution.
http://forums.msdn.microsoft.com/en-US/netfxnetcom/thread/3835dd18-878b-4b45-964b-a1ac89225b67/
|
| Author: Gaddamchandrakanth 27 Jul 2008 | Member Level: Silver | Rating:  Points: 6 |
Hi,
I think your SMTP Server may be problem.Checkout your SMTP Server Name. And i will give you some code just check out with this once.
And Configure the SMTP Server in Web.config File.
<appSettings> <add key="SmtpServer" value="smtp..easycgi.com "/> <add key="MailFrom" value="admin@mail4.easycgi.com "/> </appSettings>
protected void ConfirmationEmailForUser() { string strName, strEmailIDFrom, strUserEmalID, strPassword,strFromName, toEmailAdd,StrAddress,strCompanyName,strCity, strCountry,strState; SmtpClient smtpclient = new SmtpClient(); MailMessage message = new MailMessage(); try { string strSmtpServer = ConfigurationManager.AppSettings["SmtpServer"].ToString(); strEmailIDFrom = ConfigurationManager.AppSettings["MailFrom"].ToString(); strFromName = "Admin"; strName = txtFirstName.Text + ' ' + txtLastName.Text; StrAddress = txtAddress1.Text; if (txtAddress2.Text.Trim() != "") { StrAddress = StrAddress + ',' + txtAddress2.Text; } strCompanyName = ddlCompanyName.SelectedItem.Text; strCity = txtCity.Text; strState = txtState.Text; strCountry = ddlCountry.SelectedItem.Text; strUserEmalID = txtEmailID.Text; strPassword = txtPassword.Text; toEmailAdd = txtEmailID.Text; MailAddress fromAddress = new MailAddress(strEmailIDFrom, strFromName); message.From = fromAddress; //message.To.Add(new MailAddress(toEmailAdd, strName));
message.To.Add(new MailAddress("admin@mail4.easycgi.com ", "")); message.IsBodyHtml = true; message.Subject = "Confirmation of Registration."; string htmlBody = "<html><body>"; htmlBody = htmlBody + "<table width='500px'>"; htmlBody = htmlBody + "<tr>"; htmlBody = htmlBody + "<td>Thanks for registering on </td></tr>"; htmlBody = htmlBody + "<tr>"; htmlBody = htmlBody + "<td> Name: </td>" + "<td>" + strName + "</td> </tr>"; htmlBody = htmlBody + "<td> Address: </td>" + "<td>" + StrAddress + "</td> </tr>"; htmlBody = htmlBody + "<td> CompanyName: </td>" + "<td>" + strCompanyName + "</td> </tr>"; htmlBody = htmlBody + "<td> City: </td>" + "<td>" + strCity + "</td> </tr>"; htmlBody = htmlBody + "<td> State: </td>" + "<td>" + strState + "</td> </tr>"; htmlBody = htmlBody + "<td> Country: </td>" + "<td>" + strCountry + "</td> </tr>"; htmlBody = htmlBody + "<td> Email: </td>" + "<td>" + strUserEmalID + "</td></tr>"; htmlBody = htmlBody + "<td> Password: </td>" + "<td>" + strPassword + "</td></tr>";
htmlBody = htmlBody + "</table>"; htmlBody = htmlBody + "<br></body></html>"; message.Body = htmlBody; smtpclient.Host = strSmtpServer; smtpclient.Send(message);
Thanks and Regards Chandrakanth
|