I recently followed a tutorial on setting up nodemailer with gmail, which can be found here.
Here is how my transporter is configured:
const transportObj = {
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
type: "OAuth2",
user: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fc918599919d9590bc9b919d9590d29f9391">[email protected]</a>",
clientId: "xxxxxxxxxxx.apps.googleusercontent.com",
clientSecret: "xxxxxxxx",
refreshToken: "xxxxxxxxx",
accessToken: "xxxxxxxxxxxxxxx"
}
};
Unfortunately, when I try to create the transporter using this configuration:
let transporter = nodemailer.createTransport(transportObj);
I encounter the following error:
TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type'{ host: string; port: number; secure: boolean; auth: { type: string; user: string; serviceClient: string; privateKey: string; accessToken: string; }; }' is not assignable to parameter of type 'Transport | TransportOptions'.
Type '{ host: string; port: number; secure: boolean; auth: { type: string; user: string; serviceClient: string; privateKey: string; accessToken: string; }; }' has no properties in common with type 'TransportOptions'.
467 transporter = nodemailer.createTransport(transportObj);
Even though my transport object aligns with examples in the nodemailer documentation, I'm at a loss for what else to attempt.
Could the use of firebase cloud functions be contributing to this issue?