Email_dotNET 1.1.0

.NET Framework 4.0
dotnet add package Email_dotNET --version 1.1.0
NuGet\Install-Package Email_dotNET -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Email_dotNET" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Email_dotNET --version 1.1.0
#r "nuget: Email_dotNET, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Email_dotNET as a Cake Addin
#addin nuget:?package=Email_dotNET&version=1.1.0

// Install Email_dotNET as a Cake Tool
#tool nuget:?package=Email_dotNET&version=1.1.0

class Program { static void Main(string[] args) { string host = "smtp.gmail.com"; int port = 25; string user = "user"; string pass = "password";

	// Create Object Instance
	EmailClient emailClient = new EmailClient(user, pass);

	var mailMessage = new MailMessage
	{
		From = new MailAddress(host),
		Subject = "subject",
		Body = "<h1>Hello</h1>",
		IsBodyHtml = true,
	};
	mailMessage.To.Add("to@gmail.com");

	Console.WriteLine("1) Send: " + emailClient.Send(mailMessage));

	Console.WriteLine("2) Send: " + emailClient.Send("from@gmail.com", "to@gmail.com", "Test", "Ciao Tester"));

	EmailClient emailClient2 = new EmailClient(host, port, "noreply@gmail.com", "gmail2020", false);
	Console.WriteLine("3) Send: " + emailClient2.Send("from@gmail.com", "to@gmail.com", "Test", "Hello", "", "", false));
}

private static void SendEmailWithAttachments()
{
	string host = "smtp.gmail.com";
	int port = 25;
	string user = "user";
	string pass = "password";

	// Create Object Instance
	EmailClient emailClient = new EmailClient(host, port, user, pass);

	var mailMessage = new MailMessage
	{
		From = new MailAddress(host),
		Subject = "subject",
		Body = "<h1>Hello</h1>",
		IsBodyHtml = true,
	};
	mailMessage.To.Add("to@gmail.com");

	var attachment = new Attachment("profile.jpg", MediaTypeNames.Image.Jpeg);
	mailMessage.Attachments.Add(attachment);

	Console.WriteLine("> Send: " + emailClient.Send(mailMessage));
}

}

Product Versions
.NET Framework net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 483 10/5/2020
1.0.0 309 10/2/2020

Extensions on the Fetch .NetFramework.