AwsEmail_dotNET 1.0.0
The AwsEmail_dotNET Class Library is a high level wrapper around the Amazon SES.
The library is currently compiled at .Net 4.0 so it should work with any application running .Net 4.0 and above.
Allows sending, receiving and processing email messages in .NET applications. Includes SSL and TLS support along with OAuth and DKIM capabilities.
Install-Package AwsEmail_dotNET -Version 1.0.0
dotnet add package AwsEmail_dotNET --version 1.0.0
<PackageReference Include="AwsEmail_dotNET" Version="1.0.0" />
paket add AwsEmail_dotNET --version 1.0.0
#r "nuget: AwsEmail_dotNET, 1.0.0"
public void AWSSend(string from, string recipients)
{
// Replace sender@example.com with your "From" address.
// This address must be verified with Amazon SES.
String FROM = from; // "sender@example.com";
String FROMNAME = "Sender Name";
// Replace recipient@example.com with a "To" address. If your account
// is still in the sandbox, this address must be verified.
String TO = recipients; // "recipient@amazon.com";
// Replace smtp_username with your Amazon SES SMTP user name.
String SMTP_USERNAME = "smtp_username";
// Replace smtp_password with your Amazon SES SMTP user name.
String SMTP_PASSWORD = "smtp_password";
// If you're using Amazon SES in a region other than Stati Uniti occidentali (Oregon),
// replace email-smtp.eu-central-1.amazonaws.com with the Amazon SES SMTP
// endpoint in the appropriate AWS Region.
String HOST = "email-smtp.eu-central-1.amazonaws.com";
// The port you will connect to on the Amazon SES SMTP endpoint. We
// are choosing port 587 because we will use STARTTLS to encrypt
// the connection.
int PORT = 587;
// The subject line of the email
String SUBJECT = "Amazon SES test (SMTP interface accessed using C#)";
// The body of the email
String BODY =
"<h1>Amazon SES Test</h1>" +
"<p>This email was sent through the " +
"<a href='https://aws.amazon.com/ses'>Amazon SES</a> SMTP interface " +
"using the .NET System.Net.Mail library.</p>";
// Create and build a new MailMessage object
MailMessage message = new MailMessage();
message.IsBodyHtml = true;
message.From = new MailAddress(FROM, FROMNAME);
message.To.Add(new MailAddress(TO));
message.Subject = SUBJECT;
message.Body = BODY;
// Create Object Instance
EmailClient emailClient = new EmailClient(HOST, PORT, SMTP_USERNAME, SMTP_PASSWORD);
// Try to send the message. Show status in console.
//if (emailClient.Send(FROM, TO, SUBJECT, BODY))
if (emailClient.Send(message))
Console.WriteLine("Email sent!");
else
Console.WriteLine("The email was not sent.");
}
public void AWSSend(string from, string recipients)
{
// Replace sender@example.com with your "From" address.
// This address must be verified with Amazon SES.
String FROM = from; // "sender@example.com";
String FROMNAME = "Sender Name";
// Replace recipient@example.com with a "To" address. If your account
// is still in the sandbox, this address must be verified.
String TO = recipients; // "recipient@amazon.com";
// Replace smtp_username with your Amazon SES SMTP user name.
String SMTP_USERNAME = "smtp_username";
// Replace smtp_password with your Amazon SES SMTP user name.
String SMTP_PASSWORD = "smtp_password";
// If you're using Amazon SES in a region other than Stati Uniti occidentali (Oregon),
// replace email-smtp.eu-central-1.amazonaws.com with the Amazon SES SMTP
// endpoint in the appropriate AWS Region.
String HOST = "email-smtp.eu-central-1.amazonaws.com";
// The port you will connect to on the Amazon SES SMTP endpoint. We
// are choosing port 587 because we will use STARTTLS to encrypt
// the connection.
int PORT = 587;
// The subject line of the email
String SUBJECT = "Amazon SES test (SMTP interface accessed using C#)";
// The body of the email
String BODY =
"<h1>Amazon SES Test</h1>" +
"<p>This email was sent through the " +
"<a href='https://aws.amazon.com/ses'>Amazon SES</a> SMTP interface " +
"using the .NET System.Net.Mail library.</p>";
// Create and build a new MailMessage object
MailMessage message = new MailMessage();
message.IsBodyHtml = true;
message.From = new MailAddress(FROM, FROMNAME);
message.To.Add(new MailAddress(TO));
message.Subject = SUBJECT;
message.Body = BODY;
// Create Object Instance
EmailClient emailClient = new EmailClient(HOST, PORT, SMTP_USERNAME, SMTP_PASSWORD);
// Try to send the message. Show status in console.
//if (emailClient.Send(FROM, TO, SUBJECT, BODY))
if (emailClient.Send(message))
Console.WriteLine("Email sent!");
else
Console.WriteLine("The email was not sent.");
}
Release Notes
Extensions on the Fetch .NetFramework.
Dependencies
-
- AWSSDK.Core (>= 3.5.1.22)
- AWSSDK.SimpleEmail (>= 3.5.0.24)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version History
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 115 | 10/3/2020 |