Hi everyone, I am having a problem while sending mails through code.Actually the code is running perfectly that there is no error,but mails are not reaching to the user whom i am sending.I am pasting my code below. Please check it and tell me the problem.
System.Net.Mail.MailMessage msgMail = new System.Net.Mail.MailMessage();
msgMail.From = new System.Net.Mail.MailAddress("[email protected]");
msgMail.To.Add(new System.Net.Mail.MailAddress("[email protected]"));
string currentuseremail = web.CurrentUser.Email.ToString();
msgMail.Subject = "Request:Joing into the myitem.Title.ToString()";
msgMail.IsBodyHtml = true;
string strBody = "test mail";
msgMail.Body = strBody;
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
client.Send(msgMail);
and i configured web.config as:
<system.net>
<mailSettings>
<smtp deliveryMethod="PickupDirectoryFromIis">
<network host="smtpout.secureserver.net" port="25" defaultCredentials="true"/>
</smtp>
</mailSettings>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true"/>
</settings>
</system.net>