hi ,
I have an aspx page that sending a mail by smtp client , but it`s not work properly ! and pass an exeption : failur sending mail
here is my code :
protected void BTN_Submit_Order_Click(object sender, EventArgs e)
{
MailMessage MailMsg = new MailMessage("Sales@anahidcorp.com", "test0@anahidcorp.com");
MailMsg.Subject = "?????";
MailMsg.Body = "????";
MailMsg.IsBodyHtml = false;
MailMsg.BodyEncoding = System.Text.Encoding.Unicode;
MailMsg.SubjectEncoding = System.Text.Encoding.Unicode;
MailMsg.CC.Add("test1@anahidcorp.com");
MailMsg.CC.Add("test2@anahidcorp.com");
NetworkCredential cred = new NetworkCredential("Sales@anahidcorp.com", "mypass");
SmtpClient smtp = new SmtpClient("myserver");
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = true;
smtp.Credentials = cred;
try
{
smtp.Send(MailMsg);
}
catch ( SmtpException ex)
{
Response.Redirect("errpage.aspx?err=" +
View Complete Post