@@ -53,23 +53,37 @@ public Task SendEmailAsync(IEmailAddress from, string subject, string message, p
53
53
return this . SendEmailAsync ( from , subject , message , Enumerable . Empty < IEmailAttachment > ( ) , to ) ;
54
54
}
55
55
56
- public Task SendEmailAsync ( IEmailAddress from , IEmailAddress replyTo , string subject , string message , params IEmailAddress [ ] to )
56
+ public Task SendEmailAsync ( IEmailAddress from , IEmailAddress replyTo , string subject , string message , bool plainTextOnly , params IEmailAddress [ ] to )
57
57
{
58
- return this . SendEmailAsync ( from , replyTo , subject , message , Enumerable . Empty < IEmailAttachment > ( ) , to ) ;
58
+ return this . SendEmailAsync ( from , replyTo , subject , message , plainTextOnly , Enumerable . Empty < IEmailAttachment > ( ) , to ) ;
59
59
}
60
60
61
61
public Task SendEmailAsync ( IEmailAddress from , string subject , string message , IEnumerable < IEmailAttachment > attachments , params IEmailAddress [ ] to )
62
62
{
63
63
return this . SendEmailAsync ( from , subject , message , attachments , to . ToArray ( ) , new IEmailAddress [ 0 ] , new IEmailAddress [ 0 ] ) ;
64
64
}
65
65
66
- public Task SendEmailAsync ( IEmailAddress from , IEmailAddress replyTo , string subject , string message , IEnumerable < IEmailAttachment > attachments , params IEmailAddress [ ] to )
66
+ public Task SendEmailAsync ( IEmailAddress from , IEmailAddress replyTo , string subject , string message , bool plainTextOnly , IEnumerable < IEmailAttachment > attachments , params IEmailAddress [ ] to )
67
67
{
68
- return this . SendEmailAsync ( from , subject , message , attachments , to . ToArray ( ) , new IEmailAddress [ 0 ] , new IEmailAddress [ 0 ] , replyTo : replyTo ) ;
68
+ return this . SendEmailAsync ( from , subject , message , attachments , to . ToArray ( ) , new IEmailAddress [ 0 ] , new IEmailAddress [ 0 ] , replyTo : replyTo , plainTextOnly : plainTextOnly ) ;
69
69
}
70
70
71
- public Task SendEmailAsync ( IEmailAddress from , string subject , string message , IEnumerable < IEmailAttachment > attachments , IEmailAddress [ ] to , IEmailAddress [ ] cc , IEmailAddress [ ] bcc , IEmailAddress replyTo = null )
71
+ public Task SendEmailAsync ( IEmailAddress from , string subject , string message , IEnumerable < IEmailAttachment > attachments , IEmailAddress [ ] to , IEmailAddress [ ] cc , IEmailAddress [ ] bcc , IEmailAddress replyTo = null , bool plainTextOnly = false )
72
72
{
73
+ if ( plainTextOnly )
74
+ {
75
+ return DoMockupAndSendEmailAsync (
76
+ from ,
77
+ replyTo ,
78
+ to ,
79
+ cc ,
80
+ bcc ,
81
+ subject ,
82
+ message ,
83
+ null ,
84
+ attachments ) ;
85
+ }
86
+
73
87
return DoMockupAndSendEmailAsync (
74
88
from ,
75
89
replyTo ,
@@ -198,7 +212,10 @@ private async Task DoMockupAndSendEmailAsync(
198
212
var joinedMockedUpRecipients = string . Join ( ", " , mockedUpRecipients . Select ( r => $ "{ r . DisplayName } ({ r . Email } )") ) ;
199
213
200
214
text = string . Concat ( text , Environment . NewLine , disclaimer , Environment . NewLine , joinedMockedUpRecipients ) ;
201
- html = string . Concat ( html , "<br/><i>" , disclaimer , "<br/>" , joinedMockedUpRecipients , "</i>" ) ;
215
+ if ( html != null )
216
+ {
217
+ html = string . Concat ( html , "<br/><i>" , disclaimer , "<br/>" , joinedMockedUpRecipients , "</i>" ) ;
218
+ }
202
219
}
203
220
204
221
await this . provider . SendEmailAsync (
0 commit comments