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);
    });
}
有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
scroll top