Mangal Sisodia

Mangal Sisodia

  • NA
  • 113
  • 29.5k

How to send an email with expiry date in asp.net C# ?

Nov 7 2017 7:50 AM
I have a requirement to send bulk emails to users  for the marketing purpose where email should expire after 30 days, Please help me where i can add the expire date in the email contents, I am using C# for programming , My codes are as below
 
MailMessage mail = new MailMessage();                 
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("[email protected]");
mail.To.Add("to_address");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
MessageBox.Show("mail Send");
 

Answers (1)