Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net: System.Web.Mail vs System.Net.Mail

Tags:

.net

.net-2.0

I am considering converting a project that I've inherited from .net 1.1 to .net 2.0. The main warning I'm concerned about is that it wants me to switch from System.Web.Mail to using System.Net.Mail.

I'm not ready to re-write all the components using the obsolete System.Web.Mail, so I'm curious to hear if any community members have had problems using it under .net 2.0?

like image 284
Dana Avatar asked Sep 15 '08 16:09

Dana


People also ask

What is System Net Mail?

SmtpClient Class (System.Net.Mail)Allows applications to send email by using the Simple Mail Transfer Protocol (SMTP). The SmtpClient type is obsolete on some platforms and not recommended on others; for more information, see the Remarks section.

Where is System Net Mail?

The System. Net.Mail classes are contained in the "System. dll" file. Make sure you have a reference to System listed under References in your project.


2 Answers

System.Web.Mail is not a full .NET native implementation of the SMTP protocol. Instead, it uses the pre-existing COM functionality in CDONTS. System.Net.Mail, in contrast, is a fully managed implementation of an SMTP client.

I've had far fewer problems with System.Net.Mail as it avoids COM hell.

like image 196
Curt Hagenlocher Avatar answered Sep 20 '22 23:09

Curt Hagenlocher


Biggest issue with System.Net.Mail is that it has no support for Implicit SSL. Use System.Web.Mail until you don't have a need for Implicit SSL support.

like image 28
Travis Heseman Avatar answered Sep 20 '22 23:09

Travis Heseman