diff --git a/src/core/DigitalData.MessagingService.Application/Common/Interfaces/IImapEmailService.cs b/src/core/DigitalData.MessagingService.Application/Common/Interfaces/IImapEmailService.cs
index f365356..901c302 100644
--- a/src/core/DigitalData.MessagingService.Application/Common/Interfaces/IImapEmailService.cs
+++ b/src/core/DigitalData.MessagingService.Application/Common/Interfaces/IImapEmailService.cs
@@ -37,5 +37,14 @@ public interface IImapEmailService
///
///
DateTime? GetLastImapSyncDate(int accountId, string folder = "INBOX");
+
+ ///
+ /// Sends an email via SMTP using the account credentials and appends the sent message
+ /// to the account's IMAP Sent Items folder.
+ ///
+ Task SendAndAppendAsync(
+ EmailContext context,
+ string sentFolder = "Sent",
+ CancellationToken cancellationToken = default);
}
#endif
\ No newline at end of file
diff --git a/src/core/DigitalData.MessagingService.Application/Common/Mappings/EmailMappingProfile.cs b/src/core/DigitalData.MessagingService.Application/Common/Mappings/EmailMappingProfile.cs
index 1c79029..aafb081 100644
--- a/src/core/DigitalData.MessagingService.Application/Common/Mappings/EmailMappingProfile.cs
+++ b/src/core/DigitalData.MessagingService.Application/Common/Mappings/EmailMappingProfile.cs
@@ -20,6 +20,16 @@ public class EmailMappingProfile : Profile
.ForMember(dest => dest.Sender, opt => opt.Ignore())
.ForMember(dest => dest.Attachments, opt => opt.MapFrom(src => src.Attachments));
+ // PublishEmailViaImapCommand -> EmailContext
+ CreateMap()
+ .ForMember(dest => dest.Sender, opt => opt.Ignore())
+ .ForMember(dest => dest.Attachments, opt => opt.MapFrom(src => src.Attachments));
+
+ // PublishEmailViaOAuth2Command -> EmailContext
+ CreateMap()
+ .ForMember(dest => dest.Sender, opt => opt.Ignore())
+ .ForMember(dest => dest.Attachments, opt => opt.MapFrom(src => src.Attachments));
+
// EmailAccountDto -> EmailAccount
CreateMap();
CreateMap();