Hi
I have some code which sends email to specified person using gmail account but I want to send it with some other account .How to configure the code with other account.
The code is as below:'
private void SendMail(string fileContent)
{
MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress("rana.vikas@spicejet.com", "Kritika");
// mailMessage.To.Add("trehan.kritika@gmail.com");
// mailMessage.To.Add("rava.vikas@spicejet.com");
mailMessage.To.Add("vikas.ame79@gmail.com");
mailMessage.Subject = "Test Email";
mailMessage.IsBodyHtml = true;
mailMessage.Body = fileContent + "<br/> <br/> <br/>";
using (SmtpClient mailbox = new SmtpClient("smtp.gamil.com", 587))
{
mailbox.Credentials = new NetworkCredential("rana.vikas@spicejet.com", "paswd");
mailbox.EnableSsl = true;
mailbox.Send(mailMessage);
}
}
what has to written in place of highlighted text to send email from rana.vikas@spicejet.com to specified person.
I have some code which sends email to specified person using gmail account but I want to send it with some other account .How to configure the code with other account.
The code is as below:'
private void SendMail(string fileContent)
{
MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress("rana.vikas@spicejet.com", "Kritika");
// mailMessage.To.Add("trehan.kritika@gmail.com");
// mailMessage.To.Add("rava.vikas@spicejet.com");
mailMessage.To.Add("vikas.ame79@gmail.com");
mailMessage.Subject = "Test Email";
mailMessage.IsBodyHtml = true;
mailMessage.Body = fileContent + "<br/> <br/> <br/>";
using (SmtpClient mailbox = new SmtpClient("smtp.gamil.com", 587))
{
mailbox.Credentials = new NetworkCredential("rana.vikas@spicejet.com", "paswd");
mailbox.EnableSsl = true;
mailbox.Send(mailMessage);
}
}
what has to written in place of highlighted text to send email from rana.vikas@spicejet.com to specified person.