POST https://graph.microsoft.com/beta/me/sendMail
Content-type: application/json
{
"message": {
"subject": "Meet for lunch?",
"body": {
"contentType": "Text",
"content": "The new cafeteria is open."
},
"toRecipients": [
{
"emailAddress": {
"address": "samanthab@contoso.onmicrosoft.com"
}
}
],
"ccRecipients": [
{
"emailAddress": {
"address": "danas@contoso.onmicrosoft.com"
}
}
]
},
"saveToSentItems": "false"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var message = new Message
{
Subject = "Meet for lunch?",
Body = new ItemBody
{
ContentType = BodyType.Text,
Content = "The new cafeteria is open."
},
ToRecipients = new List<Recipient>()
{
new Recipient
{
EmailAddress = new EmailAddress
{
Address = "samanthab@contoso.onmicrosoft.com"
}
}
},
CcRecipients = new List<Recipient>()
{
new Recipient
{
EmailAddress = new EmailAddress
{
Address = "danas@contoso.onmicrosoft.com"
}
}
}
};
var saveToSentItems = false;
await graphClient.Me
.SendMail(message,saveToSentItems)
.Request()
.PostAsync();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Message message = new Message();
message.subject = "Meet for lunch?";
ItemBody body = new ItemBody();
body.contentType = BodyType.TEXT;
body.content = "The new cafeteria is open.";
message.body = body;
LinkedList<Recipient> toRecipientsList = new LinkedList<Recipient>();
Recipient toRecipients = new Recipient();
EmailAddress emailAddress = new EmailAddress();
emailAddress.address = "samanthab@contoso.onmicrosoft.com";
toRecipients.emailAddress = emailAddress;
toRecipientsList.add(toRecipients);
message.toRecipients = toRecipientsList;
LinkedList<Recipient> ccRecipientsList = new LinkedList<Recipient>();
Recipient ccRecipients = new Recipient();
EmailAddress emailAddress1 = new EmailAddress();
emailAddress1.address = "danas@contoso.onmicrosoft.com";
ccRecipients.emailAddress = emailAddress1;
ccRecipientsList.add(ccRecipients);
message.ccRecipients = ccRecipientsList;
boolean saveToSentItems = false;
graphClient.me()
.sendMail(UserSendMailParameterSet
.newBuilder()
.withMessage(message)
.withSaveToSentItems(saveToSentItems)
.build())
.buildRequest()
.post();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
message := msgraphsdk.NewMessage()
requestBody.SetMessage(message)
subject := "Meet for lunch?"
message.SetSubject(&subject)
body := msgraphsdk.NewItemBody()
message.SetBody(body)
contentType := "Text"
body.SetContentType(&contentType)
content := "The new cafeteria is open."
body.SetContent(&content)
message.SetToRecipients( []Recipient {
msgraphsdk.NewRecipient(),
emailAddress := msgraphsdk.NewEmailAddress()
SetEmailAddress(emailAddress)
address := "samanthab@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
}
message.SetCcRecipients( []Recipient {
msgraphsdk.NewRecipient(),
emailAddress := msgraphsdk.NewEmailAddress()
SetEmailAddress(emailAddress)
address := "danas@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
}
saveToSentItems := "false"
requestBody.SetSaveToSentItems(&saveToSentItems)
graphClient.Me().SendMail().Post(requestBody)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Import-Module Microsoft.Graph.Users.Actions
$params = @{
Message = @{
Subject = "Meet for lunch?"
Body = @{
ContentType = "Text"
Content = "The new cafeteria is open."
}
ToRecipients = @(
@{
EmailAddress = @{
Address = "samanthab@contoso.onmicrosoft.com"
}
}
)
CcRecipients = @(
@{
EmailAddress = @{
Address = "danas@contoso.onmicrosoft.com"
}
}
)
}
SaveToSentItems = "false"
}
# A UPN can also be used as -UserId.
Send-MgUserMail -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var message = new Message
{
Subject = "Project kickoff",
ToRecipients = new List<Recipient>()
{
new Recipient
{
EmailAddress = new EmailAddress
{
Name = "Samantha Booth",
Address = "samanthab@contoso.onmicrosoft.com"
}
}
},
Mentions = new MessageMentionsCollectionPage()
{
new Mention
{
Mentioned = new EmailAddress
{
Name = "Dana Swope",
Address = "danas@contoso.onmicrosoft.com"
}
}
}
};
await graphClient.Me
.SendMail(message,null)
.Request()
.PostAsync();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
message := msgraphsdk.NewMessage()
requestBody.SetMessage(message)
subject := "Project kickoff"
message.SetSubject(&subject)
message.SetToRecipients( []Recipient {
msgraphsdk.NewRecipient(),
emailAddress := msgraphsdk.NewEmailAddress()
SetEmailAddress(emailAddress)
name := "Samantha Booth"
emailAddress.SetName(&name)
address := "samanthab@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
}
message.SetMentions( []Mention {
msgraphsdk.NewMention(),
mentioned := msgraphsdk.NewEmailAddress()
SetMentioned(mentioned)
name := "Dana Swope"
mentioned.SetName(&name)
address := "danas@contoso.onmicrosoft.com"
mentioned.SetAddress(&address)
}
graphClient.Me().SendMail().Post(requestBody)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Import-Module Microsoft.Graph.Users.Actions
$params = @{
Message = @{
Subject = "Project kickoff"
ToRecipients = @(
@{
EmailAddress = @{
Name = "Samantha Booth"
Address = "samanthab@contoso.onmicrosoft.com"
}
}
)
Mentions = @(
@{
Mentioned = @{
Name = "Dana Swope"
Address = "danas@contoso.onmicrosoft.com"
}
}
)
}
}
# A UPN can also be used as -UserId.
Send-MgUserMail -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var message = new Message
{
Subject = "9/9/2018: concert",
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "The group represents Nevada."
},
ToRecipients = new List<Recipient>()
{
new Recipient
{
EmailAddress = new EmailAddress
{
Address = "AlexW@contoso.OnMicrosoft.com"
}
}
},
InternetMessageHeaders = new List<InternetMessageHeader>()
{
new InternetMessageHeader
{
Name = "x-custom-header-group-name",
Value = "Nevada"
},
new InternetMessageHeader
{
Name = "x-custom-header-group-id",
Value = "NV001"
}
}
};
await graphClient.Me
.SendMail(message,null)
.Request()
.PostAsync();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Message message = new Message();
message.subject = "9/9/2018: concert";
ItemBody body = new ItemBody();
body.contentType = BodyType.HTML;
body.content = "The group represents Nevada.";
message.body = body;
LinkedList<Recipient> toRecipientsList = new LinkedList<Recipient>();
Recipient toRecipients = new Recipient();
EmailAddress emailAddress = new EmailAddress();
emailAddress.address = "AlexW@contoso.OnMicrosoft.com";
toRecipients.emailAddress = emailAddress;
toRecipientsList.add(toRecipients);
message.toRecipients = toRecipientsList;
LinkedList<InternetMessageHeader> internetMessageHeadersList = new LinkedList<InternetMessageHeader>();
InternetMessageHeader internetMessageHeaders = new InternetMessageHeader();
internetMessageHeaders.name = "x-custom-header-group-name";
internetMessageHeaders.value = "Nevada";
internetMessageHeadersList.add(internetMessageHeaders);
InternetMessageHeader internetMessageHeaders1 = new InternetMessageHeader();
internetMessageHeaders1.name = "x-custom-header-group-id";
internetMessageHeaders1.value = "NV001";
internetMessageHeadersList.add(internetMessageHeaders1);
message.internetMessageHeaders = internetMessageHeadersList;
graphClient.me()
.sendMail(UserSendMailParameterSet
.newBuilder()
.withMessage(message)
.withSaveToSentItems(null)
.build())
.buildRequest()
.post();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
message := msgraphsdk.NewMessage()
requestBody.SetMessage(message)
subject := "9/9/2018: concert"
message.SetSubject(&subject)
body := msgraphsdk.NewItemBody()
message.SetBody(body)
contentType := "HTML"
body.SetContentType(&contentType)
content := "The group represents Nevada."
body.SetContent(&content)
message.SetToRecipients( []Recipient {
msgraphsdk.NewRecipient(),
emailAddress := msgraphsdk.NewEmailAddress()
SetEmailAddress(emailAddress)
address := "AlexW@contoso.OnMicrosoft.com"
emailAddress.SetAddress(&address)
}
message.SetInternetMessageHeaders( []InternetMessageHeader {
msgraphsdk.NewInternetMessageHeader(),
name := "x-custom-header-group-name"
SetName(&name)
value := "Nevada"
SetValue(&value)
msgraphsdk.NewInternetMessageHeader(),
name := "x-custom-header-group-id"
SetName(&name)
value := "NV001"
SetValue(&value)
}
graphClient.Me().SendMail().Post(requestBody)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Import-Module Microsoft.Graph.Users.Actions
$params = @{
Message = @{
Subject = "9/9/2018: concert"
Body = @{
ContentType = "HTML"
Content = "The group represents Nevada."
}
ToRecipients = @(
@{
EmailAddress = @{
Address = "AlexW@contoso.OnMicrosoft.com"
}
}
)
InternetMessageHeaders = @(
@{
Name = "x-custom-header-group-name"
Value = "Nevada"
}
@{
Name = "x-custom-header-group-id"
Value = "NV001"
}
)
}
}
# A UPN can also be used as -UserId.
Send-MgUserMail -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
POST https://graph.microsoft.com/beta/me/sendMail
Content-type: application/json
{
"message": {
"subject": "Meet for lunch?",
"body": {
"contentType": "Text",
"content": "The new cafeteria is open."
},
"toRecipients": [
{
"emailAddress": {
"address": "meganb@contoso.onmicrosoft.com"
}
}
],
"attachments": [
{
"@odata.type": "#microsoft.graph.fileAttachment",
"name": "attachment.txt",
"contentType": "text/plain",
"contentBytes": "SGVsbG8gV29ybGQh"
}
]
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var message = new Message
{
Subject = "Meet for lunch?",
Body = new ItemBody
{
ContentType = BodyType.Text,
Content = "The new cafeteria is open."
},
ToRecipients = new List<Recipient>()
{
new Recipient
{
EmailAddress = new EmailAddress
{
Address = "meganb@contoso.onmicrosoft.com"
}
}
},
Attachments = new MessageAttachmentsCollectionPage()
{
new FileAttachment
{
Name = "attachment.txt",
ContentType = "text/plain",
ContentBytes = Encoding.ASCII.GetBytes("SGVsbG8gV29ybGQh")
}
}
};
await graphClient.Me
.SendMail(message,null)
.Request()
.PostAsync();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Message message = new Message();
message.subject = "Meet for lunch?";
ItemBody body = new ItemBody();
body.contentType = BodyType.TEXT;
body.content = "The new cafeteria is open.";
message.body = body;
LinkedList<Recipient> toRecipientsList = new LinkedList<Recipient>();
Recipient toRecipients = new Recipient();
EmailAddress emailAddress = new EmailAddress();
emailAddress.address = "meganb@contoso.onmicrosoft.com";
toRecipients.emailAddress = emailAddress;
toRecipientsList.add(toRecipients);
message.toRecipients = toRecipientsList;
LinkedList<Attachment> attachmentsList = new LinkedList<Attachment>();
FileAttachment attachments = new FileAttachment();
attachments.name = "attachment.txt";
attachments.contentType = "text/plain";
attachments.contentBytes = Base64.getDecoder().decode("SGVsbG8gV29ybGQh");
attachmentsList.add(attachments);
AttachmentCollectionResponse attachmentCollectionResponse = new AttachmentCollectionResponse();
attachmentCollectionResponse.value = attachmentsList;
AttachmentCollectionPage attachmentCollectionPage = new AttachmentCollectionPage(attachmentCollectionResponse, null);
message.attachments = attachmentCollectionPage;
graphClient.me()
.sendMail(UserSendMailParameterSet
.newBuilder()
.withMessage(message)
.withSaveToSentItems(null)
.build())
.buildRequest()
.post();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
message := msgraphsdk.NewMessage()
requestBody.SetMessage(message)
subject := "Meet for lunch?"
message.SetSubject(&subject)
body := msgraphsdk.NewItemBody()
message.SetBody(body)
contentType := "Text"
body.SetContentType(&contentType)
content := "The new cafeteria is open."
body.SetContent(&content)
message.SetToRecipients( []Recipient {
msgraphsdk.NewRecipient(),
emailAddress := msgraphsdk.NewEmailAddress()
SetEmailAddress(emailAddress)
address := "meganb@contoso.onmicrosoft.com"
emailAddress.SetAddress(&address)
}
message.SetAttachments( []Attachment {
msgraphsdk.NewAttachment(),
name := "attachment.txt"
SetName(&name)
contentType := "text/plain"
SetContentType(&contentType)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.fileAttachment",
"contentBytes": "SGVsbG8gV29ybGQh",
}
}
graphClient.Me().SendMail().Post(requestBody)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。
Import-Module Microsoft.Graph.Users.Actions
$params = @{
Message = @{
Subject = "Meet for lunch?"
Body = @{
ContentType = "Text"
Content = "The new cafeteria is open."
}
ToRecipients = @(
@{
EmailAddress = @{
Address = "meganb@contoso.onmicrosoft.com"
}
}
)
Attachments = @(
@{
"@odata.type" = "#microsoft.graph.fileAttachment"
Name = "attachment.txt"
ContentType = "text/plain"
ContentBytes = "SGVsbG8gV29ybGQh"
}
)
}
}
# A UPN can also be used as -UserId.
Send-MgUserMail -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ 版で使用できるすべての種類、プロパティ、API はサポートされていません。 SDK を使用してベータ API にアクセスする方法の詳細については、「Microsoft Graph SDK とベータ API を使用する」を参照してください。