Вопрос

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 с атрибуция
Не связан с sharepoint.stackexchange
scroll top