Mail Sending Problem in Server Rejected Sender Address, Error Code 551

am getting error while sending a mail ..
i have contact us form, i need to send a mail from any domain to a speciifed domain
like from address  may be yahoo, gmail or anything but the To address will be a single domail.

here is the code which i have used.. plz can any one help me..
public bool SendMail(Panel body, string subject, string from)
            MailMessage message = new MailMessage();
            message.To = "";
            message.From = from;     // any domian.. 
            message.Subject = subject;
            message.BodyFormat = MailFormat.Html;
            message.Body = "<html><head></head><body width='550px'><div align='left' width='550px' style='font-family: Arial; font-size:x-small'>" + PanelToHtml(body) + "<br/></div></body></html>";
            string Username = "";
            string Password = "mypassword";
            message.Fields.Add("", "1"); //none, cdoBasic, NTLM
            message.Fields.Add("", Username);
            message.Fields.Add("", Password);
            message.Fields.Add("", 2); // cdoNTLM, value 2. The current process security context is used to authenticate with the service.
            message.Fields.Add("", 25);
            message.Fields.Add("", false);
            message.Fields.Add("", 60);
            string SmptServer = "";
            System.Web.Mail.SmtpMail.SmtpServer = SmptServer;
            return true;
        catch(Exception ex)
            throw ex;
    public string PanelToHtml(Panel PanelMail)
        StringBuilder sb = new StringBuilder();
        StringWriter sw = new StringWriter(sb);
        HtmlTextWriter hw = new HtmlTextWriter(sw);
        return sb.ToString();

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Melih SARICAOwnerCommented:
U dont ave rely permission on server..

Ask ur mail admin to give u rely permission..

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.