Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
React PNPJs sendemail CC and BCC not working

I have a SharePoint SPFx react web application. I'm using the following link to send emails on actions: https://pnp.github.io/pnpjs/sp/sp-utilities-utility/

My current code looks like this:

import { default as pnp, sp, ItemAddResult } from "sp-pnp-js";

export interface EmailProperties { 

    To: string[];
    CC: string[];
    BCC?: string[];
    Subject: string;
    Body: string;
    From?: string;
}

On button submit I stripped out most of my code but I have this snippet here:

async submitNewForm():Promise<any> {
    
    try {       

        //More code here

        const emailProps: EmailProperties = {
            To: ["emailhere@gmail.com"],
            CC: ["cchere@gmail.com"],
            Subject: "Title Here",
            Body: `body code here`
        };

        sp.utility.sendEmail(emailProps).then(_ => {
            console.log("Email Sent to user!");
        });             
    
        
    } catch(error) {

    }
    

}

Whenever this action get's triggered, the To works but the CC and BCC do not. I figured maybe that email address I was using was maybe blocking the email from coming. However when I put the BCC email address in the To it works. In my console I don't get any errors I get the "Email Sent to User!"

Any idea on why the CC or BCC is not working, or how I can debug this to see what's going on?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

No errors show up because you don't handle it in the catch block. I suggest adding at least a printing there to find out what's the error and go from there.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda