Procházet zdrojové kódy

Enquire Now Update

master
30117125 před 4 roky
rodič
revize
ed349b8780

+ 8
- 1
UnivateProperties_API/Repository/Communication/MailRepository.cs Zobrazit soubor

@@ -115,13 +115,20 @@ namespace UnivateProperties_API.Repository.Communication
115 115
                 "</div>";
116 116
 
117 117
             string toList = "";
118
+            int emailCount = 0;
118 119
             foreach (var recipient in recipients)
119 120
             {
120 121
                 toList += recipient.RecipientMail + ";, ";
122
+                emailCount++;
121 123
             }
122 124
 
123 125
             if (toList.Length > 0)
124
-                toList = toList.Substring(0, toList.Length - 2);
126
+            {
127
+                if (emailCount == 1)
128
+                    toList = toList.Substring(0, toList.Length - 3);
129
+                else
130
+                    toList = toList.Substring(0, toList.Length - 2);
131
+            }
125 132
 
126 133
             var host = _dbContext.Hosts.FirstOrDefault();
127 134
             using (SmtpClient smtp = new SmtpClient(host.Host))

Načítá se…
Zrušit
Uložit