Skip to content

Instantly share code, notes, and snippets.

@KamilSzymborski
Last active October 23, 2019 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KamilSzymborski/b34296581c107e0f126f070972b79dc8 to your computer and use it in GitHub Desktop.
Save KamilSzymborski/b34296581c107e0f126f070972b79dc8 to your computer and use it in GitHub Desktop.
GMail
1.
https://myaccount.google.com/lesssecureapps -> Allow apps that use less secure sign-in
2.
var Sender = new GMailSender("yourmail@gmail.com", "password");

Sender.Failed += () => Console.WriteLine("Failed");
Sender.Sended += () => Console.WriteLine("Sended");

Sender.SendAsync("Title", "Message", "recipient@anymail.com", Attachment.FromFile(@"Photo.jpg"));

Console.ReadKey();

­

­

You can also sends from ...
AOL, Mail(mail.com), Outlook, Yahoo, Yandex, Zoho

­

­

Or create your own ...
public sealed class YellowMailSender : Sender
{
    #region Constructors
      public YellowMailSender(string Login, string Password)
          : base(587, "smtp.yellow-mail.com", Login, Password)
      { }
    #endregion
}
... for AOL
 Account Security -> Allow apps that use less secure sign-in

­

... for GMail
 https://myaccount.google.com/lesssecureapps  -> Allow apps that use less secure sign-in

­

... for Mail
 you do not have to do anything

­

... for Outlook
 account must be registered / validated

­

... for Yahoo
 Account Security -> Allow apps that use less secure sign-in

­

... for Yandex
 you do not have to do anything

­

... for Zoho
 you do not have to do anything
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment