I have seen this similar question but I am still not sure how to proceed.
Recently I upgraded my Gmail API library so I don't know if it is related.
I am getting a similar error:
<LogEntry Date="2021-08-22 12:35:10" Severity="Exception" Source="MSAToolsGMailLibrary.MSAToolsGMailLibraryClass.SendEmail" ThreadId="1"> <Exception Type="Google.GoogleApiException" Source="Google.Apis.Requests.ClientServiceRequest`1+<ParseResponse>d__35.MoveNext"> <Message>Google.Apis.Requests.RequestError Recipient address required [400] Errors [ Message[Recipient address required] Location[ - ] Reason[invalidArgument] Domain[global] ] </Message> <StackTrace> at Google.Apis.Requests.ClientServiceRequest`1.<ParseResponse>d__35.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Google.Apis.Requests.ClientServiceRequest`1.Execute() at MSAToolsGMailLibrary.MSAToolsGMailLibraryClass.SendEmail(String From, String Subject, String Attachment)</StackTrace> </Exception> </LogEntry> This happenes even if I try my test code:
using Message = Google.Apis.Gmail.v1.Data.Message public bool SendTestEmail(string From, string Subject, string Body) { try { MailMessage mail = new MailMessage(); mail.Subject = Subject; mail.Body = Body; mail.From = new MailAddress(From); mail.IsBodyHtml = false; mail.To.Add(new MailAddress(From)); MimeKit.MimeMessage mimeMessage = MimeKit.MimeMessage.CreateFromMailMessage(mail); Message message = new Message(); message.Raw = Base64UrlEncode(mimeMessage.ToString()); var result = m_Service.Users.Messages.Send(message, "me").Execute(); } catch (Exception ex) { SimpleLog.Log(ex); return false; } return true; } private string Base64UrlEncode(string input) { var inputBytes = System.Text.Encoding.UTF8.GetBytes(input); return Convert.ToBase64String(inputBytes) .Replace('+', '-') .Replace('/', '_') .Replace("=", ""); } I confirm that I am connected to my account with the right credentials. Never had this problem before.