Scripting: Send email using Powershell and System.Net.Mail API

You can send email using System.Net.Mail API & PowerShell scripting. It’s easy, faster!! Lets try… Why Powershell? PowerShell is the automation platform and scripting language for Windows and Windows Server that allows you to simplify the management of your systems. Unlike other text-based shells, PowerShell harnesses the power of the .NET Framework, providing rich objects…

4

Diagnostics: How to enable debug tracing for System.Net.Mail API?

You can enable the following trace switches in your application config file, so that you can enable tracing for The System.Net.Mail library/API. This will log the contents of the SMTP session to a file. To send traces to a log file, add the following node to the <system.diagnostics> node of the appropriate configuration file (application…

1

Hotfix: Failure Sending mail error with System.Net.Mail (.Net Framework 4.0) while sending large attachment

Recently one of my customer ran into an issue with his application used to send email messages using System.Net.Mail.SmtpClient (SNM) API. He used Visual Studio 2010 and .NET Framework 4.0. It’s a pretty simple code, //Sample C# code snippet using System.Net.Mail API SmtpClient MyClient = new SmtpClient("mail_server"); MyClient.Credentials = new System.Net.NetworkCredential("User", "Password", "Domain"); MailMessage MyMsg…

2

System.Net.Mail: Mail sent via Network delivery throws exception “Command not implemented/supported”

One of the customer reported that whenever he tries to send e-mail by using System.Net.Mail API they get the following error “System.Net.Mail.SmtpException error message: Command not implemented. The server response was: Command not Supported” I had a look at the application. They built a Microsoft Visual Studio 2005 based application and tried to send e-mail…

2

CDONTS, CDOSYS, System.Web.Mail & System.Net.Mail

Microsoft Windows Server 2003 does not install Collaboration Data Objects (CDO) for NTS (CDONTS). Therefore, applications that use CDONTS do not function on a Windows Server 2003-based computer. Windows Server 2003 provides improved alternatives to CDONTS. To make applications that use CDONTS function on a Windows Server 2003-based computer, update existing CDONTS applications to use…