Here is my code
Code:
using System;
using System.Net;
using System.Net.Mail;
class MainClass
{
public static void Main()
{
{
//send the message
SmtpClient smtp = new SmtpClient("smtp.gmail.com");
smtp.Port = 465;
smtp.EnableSsl = true;
//to authenticate we set the username and password properites on the SmtpClient
smtp.Credentials = new NetworkCredential("doom1992", "MYPASSWORD-THIS IS NOT MY REAL PASSWORD");
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("[email protected]");
mail.To.Add("[email protected]");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
smtp.Send(mail);
}
}
}
I get NO erros in the IDE but the server keeps on timing out.
Can anyone help