///////////////////////
/////////////////// Godaddy
/////////////////// Gmail
/////////////////// Godaddy
public static void Email_Send_Godady(string Htmlbody, string mSubject)
{
try
{
string[] Credentials = { "Yourmail@gmail.com", "password" };
MailMessage msgs = new MailMessage();
msgs.To.Add("ToEmail
id");
msgs.From = new MailAddress(Credentials[0], "Sender
Name");
;
msgs.Subject = mSubject;
msgs.Body = Htmlbody;
msgs.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Credentials = new System.Net.NetworkCredential(Credentials[0],
Credentials[1]);
client.Host = "relay-hosting.secureserver.net";
client.Port = 25;
client.EnableSsl = false;
client.UseDefaultCredentials = false;
client.Send(msgs);
}
catch (Exception ex)
{
string msg = ex.ToString();
}
}
public static void Email_Send_Godady(string Htmlbody, string mSubject)
{
try
{
string[] Credentials = { "Yourmail@gmail.com", "password" };
MailMessage msgs = new MailMessage();
msgs.To.Add("ToEmail id");
msgs.From = new MailAddress(Credentials[0], "Sender Name"); ;
msgs.Subject = mSubject;
msgs.Body = Htmlbody;
msgs.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Credentials = new System.Net.NetworkCredential(Credentials[0], Credentials[1]);
client.Host = "smtp.gmail.com";
client.Port = 587;
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Send(msgs);
}
catch (Exception ex)
{
string msg = ex.ToString();
}
}
No comments:
Post a Comment