title: AWS SES SendRawEmailAsync not entertaining BCC
body: <p>I am sending the email using AWS SES Api, by converting the mail message into the stream, but i am not able to send the BCC. </p>
  
  <pre><code>private async Task&lt;bool&gt; SendMessageUsingAWSProfileAsync(EmailMessage message, CancellationToken token)
      {
  
          MailMessage mailMessage = GetMailMessage(message);
  
          if (mailMessage == null)
          {
              _logger.DebugFormat("Unable to create MailMessage from message: {0}.", message);
              return false;
          }
  
          SendRawEmailResponse response;
          var credentials = new BasicAWSCredentials(_settings.GetString("AWS.Key"), _settings.GetString("AWS.Secret"));
          using (var amazonClient = new AmazonSimpleEmailServiceClient(credentials, _awsRegion))
          {
              using (MemoryStream stream = ConvertMailMessageToMemoryStream(mailMessage))
              {
                  // Send Email using AWS API
                  var rawMessage = new RawMessage(stream);
  
                  List&lt;String&gt; destinations = new List&lt;string&gt;();
  
  
                  var sendRequest = new SendRawEmailRequest(rawMessage)
                  {
                      Source = mailMessage.From.Address,
                  };
  
                  response = await amazonClient.SendRawEmailAsync(sendRequest, token).ConfigureAwait(false);
              }
          }
  
          message.MessageId = response.MessageId;
          message.FromServiceId = _settings.GetString("AWS.Key");
          message.CommunicationDirectionEnum = CommunicationDirectionEnum.Out;
          await LogMessageAsync(message, token).ConfigureAwait(false);
  
          await AuditMessageAsync(message, token).ConfigureAwait(false);
  
          return true;
      }
  
  
   private MailMessage GetMailMessage(EmailMessage message)
      {
          if (message == null) throw new ArgumentNullException(nameof(message));
  
          if (string.IsNullOrEmpty(message?.Body))
          {
              _logger.DebugFormat("Empty email body.");
              return null;
          }
  
          if (string.IsNullOrEmpty(message.ToEmailID))
          {
              _logger.DebugFormat("To EmailID is empty.");
              return null;
          }
  
          List&lt;string&gt; mailAddresses = GetToEmailList(message.ToEmailID);
          List&lt;string&gt; bccMailAddresses = GetToEmailList(message.BccEmailId);
          if (mailAddresses == null || mailAddresses.Count == 0)
          {
              _logger.DebugFormat("No valid To EmailID.");
              return null;
          }
          var result = new MailMessage();
  
          foreach (var toAddress in mailAddresses)
          {
              result.To.Add(new MailAddress(toAddress));
          }
  
          foreach (var bccAddress in bccMailAddresses)
          {
              result.Bcc.Add(new MailAddress(bccAddress));
          }
  
  
  
          return result;
      }
  
  public static MemoryStream ConvertMailMessageToMemoryStream(MailMessage message)
      {
          Assembly assembly = typeof(SmtpClient).Assembly;
          Type mailWriterType = assembly.GetType("System.Net.Mail.MailWriter");
          var stream = new MemoryStream()
              ConstructorInfo mailWriterConstructor =
                  mailWriterType.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null,
                      new[] { typeof(Stream) }, null);
  
          object mailWriter = mailWriterConstructor.Invoke(new object[] { stream });
  
          MethodInfo sendMethod = typeof(MailMessage).GetMethod("Send",
              BindingFlags.Instance | BindingFlags.NonPublic);
  
          sendMethod.Invoke(message, BindingFlags.Instance | BindingFlags.NonPublic, null,
              new[] { mailWriter, true, true }, null);
  
          MethodInfo closeMethod = mailWriter.GetType()
              .GetMethod("Close", BindingFlags.Instance | BindingFlags.NonPublic);
  
          closeMethod.Invoke(mailWriter, BindingFlags.Instance | BindingFlags.NonPublic, null, new object[] { },
              null);
          return stream;
      }
  </code></pre>
  
  <p>The BCC is already into the mailMessage object, so when its converting it to raw, it should be include BCC into the headers too. I have tried including/ excluding destinations, it gives the same result.</p>
  
  <p>Any help much appreciated.</p>