AwsEmail_dotNET 1.0.0
.NET Framework 4.0
dotnet add package AwsEmail_dotNET --version 1.0.0
NuGet\Install-Package AwsEmail_dotNET -Version 1.0.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="AwsEmail_dotNET" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AwsEmail_dotNET --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AwsEmail_dotNET, 1.0.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 AwsEmail_dotNET as a Cake Addin
#addin nuget:?package=AwsEmail_dotNET&version=1.0.0
// Install AwsEmail_dotNET as a Cake Tool
#tool nuget:?package=AwsEmail_dotNET&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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.");
}
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.
-
- AWSSDK.Core (>= 3.5.1.22)
- AWSSDK.SimpleEmail (>= 3.5.0.24)
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.0.0 | 362 | 10/3/2020 |
Extensions on the Fetch .NetFramework.