Now it is possible to finnish a tournament with scores and mails

This commit is contained in:
2020-04-20 23:44:09 +02:00
parent 5d0d891024
commit ac1d5371f2
9 changed files with 144 additions and 7 deletions

View File

@ -8,11 +8,17 @@ namespace TrackerLibrary
{
public static class EmailLogic
{
public static void SendEmail(List<string> to,string subject, string body)
public static void SendEmail(string to, string subject, string body)
{
SendEmail(new List<string> { to }, new List<string>(), subject, body);
}
public static void SendEmail(List<string> to, List<string> bcc, string subject, string body)
{
MailAddress fromMailAddress = new MailAddress(GlobalConfig.AppKeyLookup("senderEmail"), GlobalConfig.AppKeyLookup("senderDisplayName"));
MailMessage mail = new MailMessage();
to.ForEach(x => mail.To.Add(x));
bcc.ForEach(x => mail.Bcc.Add(x));
mail.From = fromMailAddress;
mail.Subject = subject;
mail.Body = body;