Sending Email is not Working Properly-Exactly
hi Developers,May i know any error im my Send Email Code.
Mail not send properly so i get doubt may any mistake in my code.
Below am added
Mail Class:
public void EmailSend(string frmID, string frmName, string toID, string subMsg, String BodyMsg, bool status)
{
SmtpClient smtpclient = new SmtpClient();
MailMessage message = new MailMessage();
MailAddress fromAddress = new MailAddress("test@maduraimedicos77.com", "MADURAI MEDICOS 77 ( test@maduraimedicos77.com )");
smtpclient.Host = "108.163.250.251";
smtpclient.Port = 25;
message.From = fromAddress;
message.To.Add(toID);
message.Subject = subMsg;
message.Body = BodyMsg;
message.BodyEncoding = System.Text.Encoding.ASCII;
message.IsBodyHtml = status;
message.Priority = MailPriority.High;
NetworkCredential ocredential = new NetworkCredential("test@maduraimedicos77.com", "test123");
smtpclient.EnableSsl = true;
smtpclient.UseDefaultCredentials = false;
smtpclient.Credentials = ocredential;
smtpclient.Send(message);
}
Button Click:
objMail.EmailSend("test@maduraimedicos77.com", ":: LABMATE ASIA.NET::", txtmail.Text.Trim(), "A Mail From :: LABMATE ASIA.NET ::", BodyMessage1(txtmail.Text), true);
Response.Write("Mail Send");
in this code mail sends Gmail and yahoo account email accounts only.
if anyone got any error in my code please suggest me. i want to know my code is whether Exavt or wrong.
Thanks with
Paul.S