0 votes

Hi,

Does Mail.dll have a configuration option for placing an email in a filesystem folder instead of actually sending the email?
We would like to use this during development/debugging.

For example: in ASP.NET I can place (.eml) emails in a filesystem folder using the following web.config section.

<system.net>
<mailSettings>
    <smtp deliveryMethod="SpecifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="C:\emails" />
    </smtp>
</mailSettings>
</system.net>

Does mail.dll have a similar option?
or even better: does it also use the same XML configuration in web.config?

Kind regards,
Erik

by

1 Answer

0 votes

No, unfortunately there is not such feature in Mail.dll.

You can either create a service wrapper over Mail.dll and mock it in your unit tests, use test email addresses, or use fake email server run locally (e.g. nDumbster).

We considered this feature, however it was not clear to us, how users would expect every other method (like Connect, ConenctSSL, Login) to work.

Finally we decided not to implement it, as it seems it mixes the responsibilities and there are better approaches (mocks, fake SMTP servers).

by (301k points)
edited by
...