title: Gmail API: Using mailadress containing umlauts results in SMTPEception: The client or server is only configured for addresses with ASCII local-parts
body: <p>Trying to send an mail with the gmail api to a mail adress that contains umlauts. e.g. büro@gmail.com.
  Getting an SmtpException then:</p>
  
  <pre><code>maildress: GeneralFailure: System.Net.Mail.SmtpException: The client or server is only configured for E-mail addresses with ASCII local-parts: büro@gmail.com.
  bei System.Net.Mail.MailAddress.GetUser(Boolean allowUnicode)
  bei System.Net.Mail.MailAddress.GetAddress(Boolean allowUnicode)
  bei System.Net.Mail.MailAddress.GetSmtpAddress(Boolean allowUnicode)
  bei System.Net.Mail.SmtpClient.ValidateUnicodeRequirement(MailMessage message, MailAddressCollection recipients, Boolean allowUnicode)
  bei System.Net.Mail.SmtpClient.Send(MailMessage message)
  </code></pre>
  
  <p>I know that when I usethe .net smtp client directly you can set SmtpDeliveryFormat.International to be able to. But how to set it when I use the gmail api?</p>
  
  <pre><code>private GmailService _service;
  
  public void SendMail(MailMessage message)
  {
      message.SubjectEncoding = Encoding.UTF8;
      message.BodyEncoding = Encoding.UTF8;
      message.IsBodyHtml = true;
  
      MimeKit.MimeMessage mimeMessage = MimeKit.MimeMessage.CreateFromMailMessage(message);
      Message sendMmessage = new Message {Raw = Base64UrlEncode(mimeMessage)};
  
      _service.Users.Messages.Send(sendMmessage, _fromMailAdress).Execute();
  }
  </code></pre>
  
  <p>Since I use a google business account I can't use the SMTPClient directly, because google shut down the usage of less secure apps.</p>