Я хочу не принимать вакансию. Только принять значение EmailBody Отправить только по электронной почте
string username = "abc@gmail.com";
string password = "abc";
SmtpClient smtpclient = new SmtpClient("smtp.gmail.com");
smtpclient.Port = 465;
smtpclient.UseDefaultCredentials = false;
smtpclient.Credentials = new System.Net.NetworkCredential(username, password);
smtpclient.EnableSsl = true;
smtpclient.DeliveryMethod = SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
MailAddress fromaddress = new MailAddress(username);
mail.From = fromaddress;
mail.To.Add("xxxxx@gmail.com");
mail.Subject = ("Test Subject");
mail.IsBodyHtml = true; logic
mail.Body = ("abc : " + TextBox2.Text + "<br />" + "def : " + TextBox3.Text );
try
{
smtpclient.Send(mail);
Response.Write("<B>Email Has been sent successfully.</B>");
}
catch (Exception ex)
{
Response.Write(ex.Message);