Email HTML template
This commit is contained in:
31
Email HTML Template/EmailSendTester/Program.cs
Normal file
31
Email HTML Template/EmailSendTester/Program.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Mail;
|
||||
|
||||
namespace EmailSendTester
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
|
||||
var username = "noreply@fasetto.com";
|
||||
var password = "somepassword";
|
||||
|
||||
var msg = new MailMessage("noreply@fasetto.com", "contact@angelsix.com");
|
||||
|
||||
msg.Subject = "Verify Your Account";
|
||||
msg.Body = File.ReadAllText(@"C:\Users\Luke\Desktop\Email\emailtest.txt");
|
||||
msg.IsBodyHtml = true;
|
||||
|
||||
var smtpClient = new SmtpClient();
|
||||
smtpClient.Credentials = new NetworkCredential(username, password);
|
||||
smtpClient.Host = "smtp.office365.com";
|
||||
smtpClient.Port = 587;
|
||||
smtpClient.EnableSsl = true;
|
||||
smtpClient.Send(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user