Question

I want to send mail to some users. But when i call send mail method, it shows no errors. but email not send.here is my code.

public emailProps: EmailProperties = {
                        To: ["abc@gmail.com"],
                        CC: ["def@gmail.com"],
                        Subject: "This email is about...",
                        Body: "Here is the body. <b>This is the test mail form SharePoint/b>",
                    };
public submit = () => {        
    sp.setup({
        spfxContext: this.props.context
    });

    return sp.utility.sendEmail(this.emailProps).then(rec => {
        console.log("Email Sent!", rec);
    },
    (ex) => {
          console.log("error: ", ex);
    });
}
Était-ce utile?

La solution

According the below issue posted in GitHub, SharePoint REST API or PnP Core JS only sends an email to SharePoint site users NOT to external users.

send email to external users PnP core js.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top