Skip to content

Instantly share code, notes, and snippets.

@jamesridgway
Created December 30, 2020 18:41
Show Gist options
  • Save jamesridgway/b47fa45278fdf5699fe6d32a003968e3 to your computer and use it in GitHub Desktop.
Save jamesridgway/b47fa45278fdf5699fe6d32a003968e3 to your computer and use it in GitHub Desktop.
public class NotificationService
{
public void NewCustomer(Customer customer)
{
var msg = $"You have a new customer called: {customer.Name}";
var smpt = new SmtpClient("smtp.example.com", 25);
var smtpMessage = new SmtpMessag();
smtpMessage.Subject = "New customer";
smtpMessage.To = "[email protected]";
smtpMessage.Body = msg;
smpt.Send(smtpMessage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment