Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-12 00:00 | #99 | completed |
Clean
|
| 2026-01-11 06:20 | #98 | completed |
Clean
|
| 2026-01-10 00:00 | #92 | completed |
Clean
|
| 2026-01-06 22:28 | #78 | completed |
Clean
|
| 2025-12-29 18:00 | #48 | cancelled |
Biased
|
| 2025-12-15 00:00 | #7 | completed |
Clean
|
| 2025-12-14 05:05 | #6 | completed |
Clean
|
// Create the email content
var emailContent = new EmailContent("Welcome to Azure Communication Service Email APIs.")
{
PlainText = "This email message is sent from Azure Communication Service Email.",
Html = "<html><body><h1>Quick send email test</h1><br/><h4>This email message is sent from Azure Communication Service Email.</h4><p>This mail was sent using .NET SDK!!</p></body></html>"
};
// Create the EmailMessage
var emailMessage = new EmailMessage(
senderAddress: "donotreply@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azurecomm.net", // The email address of the domain registered with the Communication Services resource
recipientAddress: "emailalias@contoso.com",
content: emailContent);
// Create the EmailAttachment
var filePath = "C:\Users\Documents\attachment.pdf";
byte[] bytes = File.ReadAllBytes(filePath);
var contentBinaryData = new BinaryData(bytes);
var emailAttachment = new EmailAttachment("attachment.pdf", MediaTypeNames.Application.Pdf, contentBinaryData);
emailMessage.Attachments.Add(emailAttachment);
try
{
EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage);
Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}");
/// Get the OperationId so that it can be used for tracking the message for troubleshooting
string operationId = emailSendOperation.Id;
Console.WriteLine($"Email operation id = {operationId}");
}
catch (RequestFailedException ex)
{
/// OperationID is contained in the exception message and can be used for troubleshooting purposes
Console.WriteLine($"Email send operation failed with error code: {ex.ErrorCode}, message: {ex.Message}");
}