I am trying to send email outside our domain network. I have done this for months within my company domain without any problem. Now I am trying to create customer email process. the code is simple using system.net.mail
string Recipient = "someone@gmail.com";
string from = "Donotreply@mydomain.com";
MailMessage mail = new MailMessage(from, Recipient);
mail.Subject = "Your..."
mail.Body = message;
mail.IsBodyHtml = true;
SmtpClient client = new SmtpClient("mydomainip");
client.port=25;
client.UseDefaultCredentials = true;
client.Send(mail);
In the webconfig I added:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network host="mydomainip" port="25" defaultCredentials="true"/>
</smtp>
</mailSettings>
then I setup IIS with domain ip in the host and windows as credential. I am able to send email when debugging on my own computer, but once I publish the application to IIS, no email come, the application throw no error and I even receive the message email sent(I have set it up in my application). please help Note: We don't want to write the server's credential in the web.config for security purpose. Thanks