Page cover image

Email

To store and send email via an SMTP address, register the server at startup and use the AlertManager.Email() call anywhere in code later.

Code

PerigeeApplication.ApplicationNoInit("Email",  (c) => {

    //Register once
    AlertManager.RegisterSMTPServer("MyName", "MyPassword", "smtp.gmail.com", 587, true);

    var em = new System.Net.Mail.MailMessage();
    em.To.Add("[email protected]");
    em.Body = "Hello!";
    em.Subject = "Test Email";
    AlertManager.Email(em);

});

Last updated