Relay access denied on sending email
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
Now, How can I config it in my code
Thanks