// Mailjob instanzieren
using(MailJob mailJob = new MailJob())
{
// Set options
mailJobLL.From = "<From>";
mailJobLL.To = "<To>";
mailJobLL.Subject = "My Test Message";
mailJobLL.BodyHtml = File.ReadAllText(@"C:\temp\mailcontent.html");
// Set GRAPH options...
mailJob.Provider = "GRAPH";
// ... use bearer token authentication
mailJob.AdditionalOptions.Add("Graph.AuthType", "3");
// ... client id of the app
mailJob.AdditionalOptions.Add("Graph.ClientId", "697517f7-70dd-4ef9-8a5c-xxxxxxxxxxxx");
// ... azure domain
mailJob.AdditionalOptions.Add("Graph.TenantId", "fe0ef3d4-0076-4c1f-9b6c-xxxxxxxxxxxx");
// ... redirect here
mailJob.AdditionalOptions.Add("Graph.RedirectUri", "msal697517f7-70dd-4ef9-xxxxxxxxxxxx://auth");
// ... we either need user name or user object id
mailJob.AdditionalOptions.Add("Graph.UserName", "<Your Graph Username>");
mailJob.AdditionalOptions.Add("Graph.UserObjectId", "34567890-3456-3456-3456-xxxxxxxxxxxx");
// ... and of course the promised token that we previously acquired
mailJob.AdditionalOptions.Add("Graph.BearerToken", "xxxxxxxxxxxx");
// Send mail
mailJob.Send();
}
' Mailjob instanziere
Using mailJob As New MailJob()
' Set options
mailJobLL.From = "<From>"
mailJobLL.To = "<To>"
mailJobLL.Subject = "My Test Message"
mailJobLL.BodyHtml = File.ReadAllText(@"C:\temp\mailcontent.html")
' Set GRAPH options...
mailJob.Provider = "GRAPH"
' ... use bearer token authentication
mailJob.AdditionalOptions.Add("Graph.AuthType", "3");
' ... client id of the app
mailJob.AdditionalOptions.Add("Graph.ClientId", "697517f7-70dd-4ef9-8a5c-xxxxxxxxxxxx")
' ... azure domain
mailJob.AdditionalOptions.Add("Graph.TenantId", "fe0ef3d4-0076-4c1f-9b6c-xxxxxxxxxxxx")
' ... redirect here
mailJob.AdditionalOptions.Add("Graph.RedirectUri", "msal697517f7-70dd-4ef9-xxxxxxxxxxxx://auth")
' ... we either need user name or user object id
mailJob.AdditionalOptions.Add("Graph.UserName", "<Your Graph Username>")
mailJob.AdditionalOptions.Add("Graph.UserObjectId", "34567890-3456-3456-3456-xxxxxxxxxxxx")
' ... and of course the promised token that we previously acquired
mailJob.AdditionalOptions.Add("Graph.BearerToken", "xxxxxxxxxxxx")
' Send mail
mailJob.Send()
End Using