title: Microsoft Graph API - Sending email as another user
body: <p>In our application, we need to send notifications to users by email for various event triggers.</p>
  
  <p>I'm able to send email if I send as "Me" the current user, but trying to send as another user account returns an error message and I'd prefer it if notifications didn't come users' themselves and may contain info we don't want floating around in Sent folders.</p>
  
  <p>What works:</p>
  
  <pre><code>await graphClient.Me.SendMail(email, SaveToSentItems: false).Request().PostAsync();
  </code></pre>
  
  <p>What doesn't work:</p>
  
  <pre><code>string FromUserEmail = "notifications@contoso.com";
  await graphClient.Users[FromUserEmail].SendMail(email, SaveToSentItems: false).Request().PostAsync();
  </code></pre>
  
  <p>Also tried using the user object id directly:</p>
  
  <pre><code>await graphClient.Users["cd8cc59c-0815-46ed-aa45-4d46c8a89d72"].SendMail(email, SaveToSentItems: false).Request().PostAsync();
  </code></pre>
  
  <p>My application has permissions for the Graph API to "<code>Send mail as any user</code>" enabled and granted by the owner/administrator.</p>
  
  <p>The error message returned by the API:</p>
  
  <blockquote>
    <p>Code: ErrorFolderNotFound Message: The specified folder could not be
    found in the store.</p>
  </blockquote>
  
  <p>I thought this error might have been because the notifications account didn't have a sent folder, so I set the <code>SaveToSentItems</code> value to false, but I still get the same error.</p>
  
  <p>Are there any settings I need to check on the account itself to allow the app to send mail on this account or should this work?</p>
  
  <p>I have checked out the documentation here:
  <a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_sendmail" rel="noreferrer">https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_sendmail</a></p>
  
  <p>Which appears to support what I'm trying to do, but doesn't reference any folder except for the sent items folder which I'm telling the API not to save to anyway.</p>
  
  <p>We aren't intending to impersonate any actual user here, just send notification emails from within the app from this specific account (which I know is technically impersonation, but not of a real entity).</p>