public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_SMTP(); string dstEmail = dataDir + "test-load.eml"; Aspose.Email.Mail.SmtpClient client = new Aspose.Email.Mail.SmtpClient("smtp.gmail.com"); // Set username client.Username = "******"; // Set password client.Password = "******"; // Set the port to 587. This is the SSL port of SMTP server client.Port = 587; // Set the security mode to explicit client.SecurityOptions = SecurityOptions.Auto; //Declare msg as MailMessage instance MailMessage msg = new MailMessage(); //use MailMessage properties like specify sender, recipient and message msg.To = "*****@*****.**"; msg.From = "*****@*****.**"; msg.Subject = "Test Email"; msg.Body = "Hello World!"; try { //Client will send this message client.Send(msg); //Show only if message sent successfully System.Console.WriteLine("Message sent"); } catch (System.Exception ex) { System.Diagnostics.Trace.WriteLine(ex.ToString()); } Console.WriteLine(Environment.NewLine + "Email sent SSL successfully."); }