Forum Discussion
jnr-O365
Apr 04, 2019Copper Contributor
Send an email from SPFx client-side webpart without exchange online
Hello All, We're trying to build an spfx client-side webpart which should send a confirmation email to the user logged in (CC'in a mailbox) on a button click. I have tried Graph Api and pnp.js, a...
- Apr 04, 2019Why not use SPO REST API? https://gist.github.com/BasantPandey/05189832546f2c6cc0bd008fcfec3264
pallavisharma
Jun 07, 2019Copper Contributor
I am trying to use the GraphAPI for sending mail through SPFX : SendAs. But things are not working for me. PFB the code example. Could you please post a sample of what you have implemented.
I have verified the 'SendAs' permission in EAC as well.
The error that I am getting clearly depicts that it is a permission issue, but I am not able to figure out .
"The user account which was used to submit this request does not have the right to send mail on behalf of the specified sending account".
My code :
Mail Message :
from:
{
emailAddress: { address: "shared-mailbox@domain.com" }
}
My Graph client :
const graphClient: MSGraphClient = await this.props.context.msGraphClientFactory.getClient();
await graphClient
.api(`users/admin@domain.com/sendMail`)
Any guidance will be highly appreciated !
jnr-O365
Aug 20, 2019Copper Contributor
pallavisharma: I think you can only send email to a valid SharePointOnline user when you're using mail end point in Graph. You may not be able to send emails to outlook mailbox.