Email HTML template

This commit is contained in:
Luke Malpass
2018-04-20 16:20:55 +01:00
parent bb7c1841f9
commit 110e6eeb49
14 changed files with 438 additions and 0 deletions

View File

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2037
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EmailSendTester", "EmailSendTester.csproj", "{916EE023-523E-473C-BF2E-871CABE9B6B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{916EE023-523E-473C-BF2E-871CABE9B6B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{916EE023-523E-473C-BF2E-871CABE9B6B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{916EE023-523E-473C-BF2E-871CABE9B6B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{916EE023-523E-473C-BF2E-871CABE9B6B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FF87D8A7-89B5-416D-9948-F322202220AD}
EndGlobalSection
EndGlobal

View 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);
}
}
}