Reputation: 1013
I'm looking at rewriting an old asp.net site I inherited. It uses aspNetEmail for sending emails, requiring only the mail server for connecting to our exchange server.
I'd like to remove as much reliance on external libraries as possible so was wondering if Microsoft have made a .net equivalent which is as easy to configure/use?
I've looked at EWS API etc but they all require either user authentication or hardcoded username/password for connecting to Exchange, and it also seems to send from an existing account whereas currently with aspNetEmail (and what I'd like to continue doing) is sending from a generic (possibly non existing) address but from the correct/valid domain (and possibly adding a valid reply-to address).
Have I missed something obvious? Should I just stick with aspNetEmail?
Upvotes: 0
Views: 1013
Reputation: 31198
The built-in System.Net.Mail
namespace has enough features for most scenarios.
If you want to avoid storing the credentials in the configuration file, it's fairly easy to point it at the pickup directory for the local IIS SMTP service, and configure the service to deliver messages to your Exchange server with the appropriate authentication.
Alternatively, you could configure the SMTP settings at the server level, and the credentials would be stored in the applicationHost.config
file in the system directory.
This article has a decent walkthrough of the options.
Upvotes: 3