namespace System.Web.Mail
{
-#if NET_2_0
-#pragma warning disable 618
-#endif
// CAS
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_2_0
- [Obsolete ("The recommended alternative is System.Net.Mail.SmtpClient.")]
-#endif
+ [Obsolete ("The recommended alternative is System.Net.Mail.SmtpClient. http://go.microsoft.com/fwlink/?linkid=14202")]
public class SmtpMail
{
- private static string smtpServer = "localhost";
+ static string smtpServer = "localhost";
- // Constructor
- private SmtpMail ()
+ // Constructor
+ SmtpMail ()
{
/* empty */
- }
+ }
// Properties
public static string SmtpServer {
// access to properties and to add some functionality
MailMessageWrapper messageWrapper = new MailMessageWrapper( message );
-#if TARGET_JVM
- string currentSmtpServer = smtpServer;
- if (currentSmtpServer == "localhost")
- {
- java.net.InetAddress address = java.net.InetAddress.getLocalHost();
- currentSmtpServer = address.getHostAddress();
- }
- SmtpClient smtp = new SmtpClient (currentSmtpServer);
-#else
SmtpClient smtp = new SmtpClient (smtpServer);
-#endif
smtp.Send (messageWrapper);
Send (message);
}
}
-#if NET_2_0
-#pragma warning restore 618
-#endif
}