Last active
February 15, 2021 04:48
-
-
Save matt-goldman/8fbb4a3a3865298245a06f0ce3f6a92a to your computer and use it in GitHub Desktop.
Code samples for FluentEmail with Graph API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var graphSenderOptions = new GraphSenderOptions | |
{ | |
ClientId = "3724c544-7da0-4115-9f9b-2c43a2b806cf", | |
Secret = "qBi:FzxcyC57Cz8JGLwMt&", | |
TenantId = "c332bd38-f4c6-44a9-9654-9838abec437e", | |
SaveSentItems = true | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddFluentEmail("mail@goforgoldman.com", "GoForGoldman Mail Service") | |
.AddRazorRenderer() | |
.AddGraphSender(graphSenderOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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