Skip to content

Do we need to instantiate the AmazonSimpleEmailServiceClient everytime we're gonna send an email for the entire lifespan of our application? #1974

Closed
@penguinawesome

Description

@penguinawesome

We are planning to use the AWS SES C# SDK for sending emails coming from a background service / windows service that runs 24/7.

In the official documentation: https://aws.amazon.com/blogs/messaging-and-targeting/getting-started-with-amazon-ses-and-net/

The example was

using (var client = new AmazonSimpleEmailServiceClient(awsAccessKey, awsSecretKey))
   {
   		 client.SendEmail(request);
   }	

it looks like it is instantiating everytime it will send an email, do we really need to do this for our scenario? Or it would be better to instantiate it in a singleton? Just like in c# httpclient and httpclient factory.

Metadata

Metadata

Assignees

Labels

guidanceQuestion that needs advice or information.module/sdk-coreresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions