Example #1
0
        internal static async Task SendAsync(string toMailAddress, string subject, string body, string path)
        {
            EmailDto dto = new EmailDto();

            dto.To.Add(toMailAddress);
            dto.Subject         = subject;
            dto.Body            = body;
            dto.AttachmentS3Url = path;

            await EmailService.SendAsync(dto).ConfigureAwait(false);
        }
Example #2
0
        internal static async Task SendAsync(EmailDto email, StringBuilder sb)
        {
            if (sb != null)
            {
                using (StreamWriter sw = new StreamWriter(new MemoryStream()))
                {
                    sw.Write(sb.ToString());
                    sw.Flush();

                    email.AttachmentData = sw.BaseStream.ToByteArray();
                }
            }
            await EmailService.SendAsync(email).ConfigureAwait(false);
        }