I am trying to send mail from gmail and it's sent successfully in localhost but when publish website on server didn't send
JAY SINGH YADAV
1
Reputation point
My Code Running fine on Local Host.
mail.From = new MailAddress("xyz@Stuff .com");
mail.To.Add(ObjBE.Email1);
mail.Subject = Subject;
//mail.Priority = MailPriority.High;
mail.Body = body;
mail.IsBodyHtml = true;
using (SmtpClient smtp = new SmtpClient("smtp.gmail.com", 25))//For Local use 587 Port
{
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("******@gmail.com", "*********"); // **** is gmail Secure Password.
smtp.EnableSsl = true;
smtp.Send(mail);
}
Windows development | Internet Information Services
1,753 questions
Developer technologies | .NET | Other
Developer technologies | .NET | Other
Microsoft Technologies based on the .NET software framework
4,107 questions
Developer technologies | ASP.NET | Other
3,601 questions
Sign in to answer