Skip to content

Instantly share code, notes, and snippets.

@matt-goldman
Last active February 15, 2021 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt-goldman/8fbb4a3a3865298245a06f0ce3f6a92a to your computer and use it in GitHub Desktop.
Save matt-goldman/8fbb4a3a3865298245a06f0ce3f6a92a to your computer and use it in GitHub Desktop.
Code samples for FluentEmail with Graph API
var graphSenderOptions = new GraphSenderOptions
{
ClientId = "3724c544-7da0-4115-9f9b-2c43a2b806cf",
Secret = "qBi:FzxcyC57Cz8JGLwMt&",
TenantId = "c332bd38-f4c6-44a9-9654-9838abec437e",
SaveSentItems = true
};
services.AddFluentEmail("mail@goforgoldman.com", "GoForGoldman Mail Service")
.AddRazorRenderer()
.AddGraphSender(graphSenderOptions);
var email = await Email
.From("john@email.com") // You can use .DefaultSender to use the sender specified in service registration, or override it here
.To("bob@email.com", "bob")
.Subject("hows it going bob")
.Body("yo bob, long time no see!")
.SendAsync();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment