Browse Source

Enquire Now Update

master
30117125 4 years ago
parent
commit
ed349b8780

+ 8
- 1
UnivateProperties_API/Repository/Communication/MailRepository.cs View File

115
                 "</div>";
115
                 "</div>";
116
 
116
 
117
             string toList = "";
117
             string toList = "";
118
+            int emailCount = 0;
118
             foreach (var recipient in recipients)
119
             foreach (var recipient in recipients)
119
             {
120
             {
120
                 toList += recipient.RecipientMail + ";, ";
121
                 toList += recipient.RecipientMail + ";, ";
122
+                emailCount++;
121
             }
123
             }
122
 
124
 
123
             if (toList.Length > 0)
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
             var host = _dbContext.Hosts.FirstOrDefault();
133
             var host = _dbContext.Hosts.FirstOrDefault();
127
             using (SmtpClient smtp = new SmtpClient(host.Host))
134
             using (SmtpClient smtp = new SmtpClient(host.Host))

Loading…
Cancel
Save