Wednesday, November 24, 2010

C# Smtp Client using gmail account


using System;
using System.Collections.Generic;
using System.Text;

using System.Net.Mail;
using System.Net;

namespace SmtpMail
{
class Program
{

static void Main(string[] args)
{
try
{
var client = new SmtpClient("smtp.gmail.com", 587)
{
Credentials = new NetworkCredential("compelligencelocal@gmail.com", "xxxxx"),
EnableSsl = true
};
client.Send("myusername@gmail.com", "manager_27@hotmail.com", "test", "testbody");
Console.WriteLine("Sent");
Console.ReadLine();

}
catch (Exception ex)
{
Console.WriteLine( ex.Message );
}

}
}
}

No comments:

Running apps

Runtastic (I uninstalled because force to update your device - Internet connection problems) Runkeeper  (Currently testing) Runna (Complex,...