Простое консольное приложение которое позволяет отправить email. Нужно указать свой Smtp-сервер в SmtpMail.SmtpServer, по умолчанию это localhost. Чтобы добавить System.Web.Mail идём в Project->Add Reference на вкладке .Net выбираем System.Web.
Вариант 1:
PHP код:
using System;
using System.Web.Mail;
namespace SendMail
{
/// <summary>
/// Test console application to demonstrate sending e-mail.
/// </summary>
class TestMail
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
TestMail.Send("test@mail.ru",
"recip@mail.ru",
"Test Message Using CDOSYS",
"Hello World! This is a simple message sent
using CDOSYS.");
}