Closed rkraghuwanshi closed 4 months ago
Can you confirm the user is in the Site User Information list?
You can load & check here
/_layouts/15/people.aspx?MembershipGroupId=0
If not, make sure you ensure the user. https://pnp.github.io/pnpjs/sp/site-users/#ensure-user
This API does not support sending to external recipients, just in case you are hitting that.
Can you confirm the user is in the Site User Information list?
You can load & check here
/_layouts/15/people.aspx?MembershipGroupId=0
If not, make sure you ensure the user. https://pnp.github.io/pnpjs/sp/site-users/#ensure-user
The user info exists in this list
This API does not support sending to external recipients, just in case you are hitting that.
The user is internal recipient.
Hmm... I'm not sure. If the email is in the user info list, and they are internal... I'm not sure what else it could be.
As we're just wrapping the SharePoint APIs, and it works for some emails but not others, it doesn't feel like it's an issue with the PnPjs library.
I concur with @bcameron1231 and can add anecdotally that I've had intermittent problems with the endpoint myself and have, for things that I need more reliability, started using the Graph mail endpoints instead.
At this point the best thing would be to open a support ticket. As mentioned this library is a pass-through to the existing APIs. If you believe the user is correct and should work, support should be able to determine why it is failing for a given request by timestamp and request id.
Closing this issue as answered. If you have additional questions or we did not answer your question, please open a new issue, ref this issue, and provide any additional details available. Thank you!
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.
Major Version
3.x
Minor Version Number
0
Target environment
SharePoint Framework
Additional environment details
SPFx form customizer extension - 1.16.1 PnPJs - 3.14.0 NodeJs - v16.19.0
Expected or Desired Behavior
I'm encountering an issue while using pnp/sp Utility along with SPFx to create form that sends an email to a user upon submission. The problem arises specifically for certain users, where the utility returns a "The e-mail message cannot be sent. Make sure the e-mail has a valid recipient" error message despite confirming that the email properties are correct during debugging. Here are the details:
Context:
Problem:
Expected Behavior:
Observed Behavior
The utility fails to send an email to certain users, citing a "The e-mail message cannot be sent. Make sure the e-mail has a valid recipient" error message.
I have thoroughly debugged the code and verified that the email properties are correct before invoking the utility function.
The affected users do exist within the system, and they have the necessary permissions within the SharePoint site.
Steps to Reproduce
Below is code snippet I am using, followed by request payload and response:
const sp: SPFI = getSP(context); return sp.utility.sendEmail(emailProps).then((success) => { return true; }).catch((err) => { return false; });
Request payload:![send email request](https://github.com/pnp/pnpjs/assets/55997894/40550f9b-e575-4651-9c45-124c46181c9a)
Response:![sendemail Error](https://github.com/pnp/pnpjs/assets/55997894/821dfee6-f027-4597-9925-9b4dd52730fa)