Skip to content

Instantly share code, notes, and snippets.

@gbrunton
Created January 8, 2013 22:03
Sending Anonymous Emails
using System;
using System.Net.Mail;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
using (var client = new SmtpClient("aspmx.l.google.com"))
{
var mailMessage = new MailMessage();
mailMessage.Subject = "test email";
mailMessage.Body = "this is a test";
mailMessage.To.Add("LarryPage@gmail.com");
mailMessage.From = new MailAddress("SergeyBrin@gmail.com");
client.Send(mailMessage);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment