Relay access denied on sending email
07:54 24 Sep 2012

I want to send email via my desktop app
Here is my code

        MailMessage m = new MailMessage("mahmoud@isysway.com", "gavoh3d@yahoo.com", "subject", "body");
        m.IsBodyHtml = true;
        SmtpClient smtp = new SmtpClient("out.tedata.net.eg");
        smtp.Credentials = new System.Net.NetworkCredential("mahmoud@isysway.com", "password");
        smtp.UseDefaultCredentials = true;
        smtp.Send(m);

My problem is: this code throw an exception

Transaction failed. The server response was: 5.7.1 : Relay access denied

I think because my internet provider need outgoing server (SMTP) authentication I config it in Outlook as below enter image description here
Now, How can I config it in my code

Thanks

c# visual-studio-2010 c#-4.0 smtp