Getting error to send email using c#

I am using relay-hosting.secureserver.net as a smtp server and i am getting following error: Mailbox name not allowed. The server response was: sorry, relaying denied from your location [212.78.237.157] (#5.7.1)

Did i need to change smtp setting or any thing else?

Here is code:

var mailClient = new SmtpClient();

mailClient.Credentials = new NetworkCredential { UserName = "alerts@mycloudcctv.com", Password = "xyz" };

mailClient.Host = "relay-hosting.secureserver.net";
mailClient.EnableSsl = false;
mailClient.DeliveryMethod=SmtpDeliveryMethod.Network;

var mail = new MailMessage("alerts@mycloudcctv.com", "azharmalik3@yahoo.com", "Test Smtp server", "Testing mycloudcctv server") { IsBodyHtml = true };

mailClient.Send(mail);

Answers


make sure,

  1. you have specified the correct user name and password in Host SMTP Settings section
  2. Use a valid email address in your user account,
  3. Check are you allowed to send mails from your SMTP server.

Need Your Help

CSS not working in IE?

css internet-explorer firefox safari

Been working on this site for some time now, works perfectly on Mac and PC Firefox, as well as Safari. However, IE is making the site almost blank - any ideas on what is going on? Any workarounds?

Issues with Fast Scroll in Android 4.4

android android-listview android-4.4-kitkat

I wrote an app which contains a ListView in its layout that supports fast scroll (i.e. dragging the scroll bar slider allows you to quickly scroll up or down the list). This worked perfectly in all