diff --git a/FluentEmail.Graph.Tests/GraphSenderTests.cs b/FluentEmail.Graph.Tests/GraphSenderTests.cs index c550adff..c899e812 100644 --- a/FluentEmail.Graph.Tests/GraphSenderTests.cs +++ b/FluentEmail.Graph.Tests/GraphSenderTests.cs @@ -14,8 +14,7 @@ public class Tests const string tenantId = ""; //Add your AAD Tenant ID here const string graphSecret = ""; //Add your AAD Graph Client Secret here const string senderEmail = ""; //Add a sender email address from your Office 365 tenant - const string toEmail = "fluentEmail@mailinator.com"; - const string toName = "FluentEmail Mailinator"; + const string toEmail = "fluentemail@mailinator.com"; //change this if you like private bool saveSent = false; [SetUp] @@ -50,7 +49,7 @@ public async Task CanSendEmailAsync() var email = Email .From(senderEmail) .To(toEmail) - .Subject("Test Email") + .Subject("Test Async Email") .Body("Test email from Graph sender unit test"); var response = await email.SendAsync(); @@ -76,7 +75,7 @@ public async Task CanSendEmailWithAttachments() var email = Email .From(senderEmail) .To(toEmail) - .Subject("Test Email") + .Subject("Test Email with Attachments") .Body("Test email from Graph sender unit test") .Attach(attachment); @@ -90,7 +89,7 @@ public async Task CanSendHighPriorityEmail() var email = Email .From(senderEmail) .To(toEmail) - .Subject("Test Email") + .Subject("Test High Priority Email") .Body("Test email from Graph sender unit test") .HighPriority(); diff --git a/FluentEmail.Graph/GraphSender.cs b/FluentEmail.Graph/GraphSender.cs index ca4503f3..1faa451b 100644 --- a/FluentEmail.Graph/GraphSender.cs +++ b/FluentEmail.Graph/GraphSender.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -120,6 +121,8 @@ public async Task SendAsync(IFluentEmail email, CancellationToken? if(email.Data.Attachments != null && email.Data.Attachments.Count > 0) { + message.Attachments = new MessageAttachmentsCollectionPage(); + email.Data.Attachments.ForEach(a => { var attachment = new FileAttachment