C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Error in sending mail


Posted Date: 27 Jul 2008      Posted By: nitin      Member Level: Bronze     Points: 1   Responses: 2



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.






Responses

Author: shanmukha kumari    27 Jul 2008Member Level: GoldRating: 2 out of 52 out of 5     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 2008Member Level: SilverRating: 2 out of 52 out of 5     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



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : retrrieve images from database to Imagebutton in C#.NEt
Previous : redirecting values to another page
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use