[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
#if NET_2_0
- [Obsolete]
+ [Obsolete ("The recommended alternative is System.Net.Mail.SmtpClient.")]
#endif
- public class SmtpMail
+ public class SmtpMail
{
private static string smtpServer = "localhost";
// 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);