static void SendAsyncEmail() { // set network settings of your SMTP server string host = "SMTP_SERVER_HOST_ADDRESS"; int port = 0; // "SMTP_SERVER_IP"; string userName = "******"; string password = "******"; bool enableSsl = false; // true EmailSettings.NetworkSettings networkSettings = new EmailSettings.NetworkSettings( host, port, userName, password, enableSsl); // create and e-mail Email email = new Email(); // set properties email.NetworkSettings = networkSettings; email.From = "YOUR_EMAIL_ADDRESS"; email.To = new string[] { "EMAIL_ADDRESS_1", "EMAIL_ADDRESS_2", "EMAIL_ADDRESS_2", "..." }; email.Subject = "EMAIL_SUBJECT"; email.Body = "EMAIL_BODY"; // set async properties and events email.IsAsync = true; email.Token = _asyncToken; email.SendCompleted += new Email.SendCompletedEventHandler(email_SendCompleted); // send e-mail email.Send(); // show message // we can see this message immediately ShowMessage("Sending email..."); }
static void SendEmail() { // set network settings of your SMTP server string host = "SMTP_SERVER_HOST_ADDRESS"; int port = 0; // "SMTP_SERVER_IP"; string userName = "******"; string password = "******"; bool enableSsl = false; // true EmailSettings.NetworkSettings networkSettings = new EmailSettings.NetworkSettings( host, port, userName, password, enableSsl); // create and e-mail Email email = new Email(); // set properties email.NetworkSettings = networkSettings; email.From = "YOUR_EMAIL_ADDRESS"; email.To = new string[] { "EMAIL_ADDRESS_1", "EMAIL_ADDRESS_2", "EMAIL_ADDRESS_2", "..." }; email.Subject = "EMAIL_SUBJECT"; email.Body = "EMAIL_BODY"; // send e-mail email.Send(); // show message // we can see this message when e-mail is transmitted ShowMessage("Email has been sent!"); }