public EmailService(MailServiceInfo mailInfo) { MailAccount = mailInfo.MailAccount; Password = mailInfo.Password; SendAddress = mailInfo.SendAddress; DisplayName = mailInfo.DisplayName; Host = mailInfo.Host; Timeout = mailInfo.Timeout; PortNumber = mailInfo.PortNumber; }
public EmailService(MailServiceInfo mailInfo) { MailAccount = mailInfo.MailAccount; Password = mailInfo.Password; SendAddress = mailInfo.SendAddress; DisplayName = mailInfo.DisplayName; Host = mailInfo.Host; Timeout = mailInfo.Timeout; PortNumber = mailInfo.PortNumber; }
private async void SendMailBtn_Click(object sender, EventArgs e) { var info = new MailServiceInfo { Host = "smtp.sendgrid.net", DisplayName = "Joe Bloggs", MailAccount = "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", Password = "******", PortNumber = 10000, SendAddress = "*****@*****.**", Timeout = 25000 }; var message = new EmailMessage { Body = "This email shows that the debug code is working", Destination = "*****@*****.**", Subject = "Test Email" }; var service = new EmailService(info); await service.SendAsync(message); }