You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/email/includes/send-email-java.md
+43-8Lines changed: 43 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ EmailClient emailClient = new EmailClientBuilder()
119
119
120
120
### Option 2: Authenticate using Azure Active Directory
121
121
122
-
A `DefaultAzureCredential` object must be passed to the `EmailClientBuilder` via the `credential()` method. An endpoint must also be set via the `endpoint()` method.
122
+
A [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#defaultazurecredential) object must be passed to the `EmailClientBuilder` via the `credential()` method. An endpoint must also be set via the `endpoint()` method.
123
123
124
124
The `AZURE_CLIENT_SECRET`, `AZURE_CLIENT_ID`, and `AZURE_TENANT_ID` environment variables are needed to create a `DefaultAzureCredential` object.
125
125
@@ -158,10 +158,43 @@ EmailMessage message = new EmailMessage()
158
158
.setSubject("Welcome to Azure Communication Services Email")
159
159
.setBodyPlainText("This email message is sent from Azure Communication Services Email using the Java SDK.");
You can download the sample app demonstrating this action from [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/send-email)
273
+
You can download the sample app demonstrating this action from [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/send-email-advanced)
For more information on acceptable MIME types for email attachments, see the [allowed MIME types](../../../concepts/email/email-attachment-allowed-mime-types.md) documentation.
266
301
267
-
You can download the sample app demonstrating this action from [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/send-email)
302
+
You can download the sample app demonstrating this action from [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/send-email-advanced)
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/email/includes/send-email-net.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,12 +124,12 @@ EmailClient emailClient = new EmailClient(connectionString);
124
124
125
125
### Option 2: Authenticate using Azure Active Directory
126
126
127
-
To authenticate using Azure Active Directory, install the `Azure.Identity` library package for .NET by using the `dotnet add package` command.
127
+
To authenticate using [Azure Active Directory](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity), install the `Azure.Identity` library package for .NET by using the `dotnet add package` command.
128
128
129
129
```console
130
130
dotnet add package Azure.Identity
131
131
```
132
-
Open **Program.cs** in a text editor and replace the body of the `Main` method with code to initialize an `EmailClient` using `DefaultAzureCredential`. The Azure Identity SDK reads values from three environment variables at runtime to authenticate the application. Learn how to [create an Azure Active Directory Registered Application and set the environment variables](../../identity/service-principal.md?pivots=platform-azcli).
132
+
Open **Program.cs** in a text editor and replace the body of the `Main` method with code to initialize an `EmailClient` using [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#defaultazurecredential). The Azure Identity SDK reads values from three environment variables at runtime to authenticate the application. Learn how to [create an Azure Active Directory Registered Application and set the environment variables](../../identity/service-principal.md?pivots=platform-azcli).
133
133
134
134
```csharp
135
135
// This code demonstrates how to authenticate to your Communication Service resource using
print(f"Successfully sent the email (operation id: {poller.result()['id']})")
259
259
else:
260
260
raiseRuntimeError(str(poller.result()["error"]))
@@ -279,7 +279,7 @@ You can download the sample app from [GitHub](https://github.com/Azure-Samples/c
279
279
280
280
### Send an email message to multiple recipients
281
281
282
-
We can define multiple recipients by adding more EmailAddresses to the EmailRecipients object. These addresses can be added as `to`, `cc`, or `bcc` recipient lists accordingly.
282
+
We can define multiple recipients by adding more email addresses to the `recipients` object. These addresses can be added as `to`, `cc`, or `bcc` recipient lists accordingly.
283
283
284
284
```python
285
285
message = {
@@ -306,20 +306,18 @@ message = {
306
306
}
307
307
```
308
308
309
-
You can download the sample app demonstrating this action from [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/send-email)
309
+
You can download the sample app demonstrating this action from [GitHub](https://github.com/Azure-Samples/communication-services-python-quickstarts/tree/main/send-email-advanced)
310
310
311
311
312
312
### Send an email message with attachments
313
313
314
-
We can add an attachment by defining an EmailAttachment object and adding it to our EmailMessage object. Read the attachment file and encode it using Base64. Decode the bytes as a string and pass it into the EmailAttachment object.
314
+
We can add an attachment by defining an `attachment`and adding it to the `attachments` of our `message` object. Read the attachment file and encode it using Base64. Decode the bytes as a string and pass it into the `attachment` object.
For more information on acceptable MIME types for email attachments, see the [allowed MIME types](../../../concepts/email/email-attachment-allowed-mime-types.md) documentation.
350
348
351
-
You can download the sample app demonstrating this action from [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/send-email)
349
+
You can download the sample app demonstrating this action from [GitHub](https://github.com/Azure-Samples/communication-services-python-quickstarts/tree/main/send-email-advanced)
0 commit comments