How to send an alert reminder with an email using C# code

  • Thread starter Thread starter Naz777
  • Start date Start date
N

Naz777

Guest

Hi

I am trying to send an alert reminder with the email that my application is sending,

I am adding the reminder to the email header at this line:

email.Headers.Add("Follow-up-by", string.Format("{0: dd MM yyyy HH:mm:ss zz}", ReplyDate));

I am getting the email but no reminder alert on the header. any idea what am I doing wrong?

Thank you!





public void Send(string recipientEmail, string emailBody, string emailSubject)
{
MailMessage email = new MailMessage();
SmtpClient smtpServer = new SmtpClient(_settings.EmailServer);

DateTime ReplyDate = DateTime.Now.AddDays(5);
//email.Headers.Add("X-Message-Flag", "Follow up");
email.Headers.Add("Follow-up-by", string.Format("{0: dd MM yyyy HH:mm:ss zz}", ReplyDate));

email.From = new MailAddress(_settings.SenderEmail);

if (!string.IsNullOrEmpty(_settings.TestingEmail))
{
email.To.Add(_settings.TestingEmail);
}
else
{
email.To.Add(recipientEmail);
}

email.Subject = emailSubject;

email.IsBodyHtml = true;
email.Body = emailBody;

smtpServer.Send(email);
}
}






I am getting the email but no reminder on the header.


Thank you!


Continue reading...
 
Back
Top