Archived Forum Post

Index of archived forum posts

Question:

Save email to file without sending

May 31 '17 at 21:52

Does the Chilkat Email .NET library have a possibility of a debug-like setting (ideally in the Web/App.config) to redirect ALL sent emails to a local file, or to redirect ALL to a single email address regardless of the actual recipient set?

Something like PickupDirectory setting for the Microsoft SmtClient.


Answer

The MailMan.SendEmail method is equivalent to a call to MailMan.RenderToMime(emailObject) followed by a call to MailMan.SendMime. The MIME string returned by RenderToMime is the "rendered email" that is passed to SendMime. The "rendered email" is the MIME that is produced by applying any signatures or encryption. You could call RenderToMime (or RenderToMimeBd, or RenderToMimeSb) and then save the result to a file.