eleith / emailjs

html emails and attachments to any smtp server with nodejs
MIT License
2.19k stars 230 forks source link

Attempted import error: 'SMTPClient' is not exported from 'emailjs'. #281

Closed kdeasymoneysniper closed 3 years ago

kdeasymoneysniper commented 3 years ago

Hi, I am using this package within React, and when attempting to import the package using import { SMTPClient } from 'emailjs';

    const client = new SMTPClient({
        user: "<my_email>",
        password: "<my_email_password>",
        host: 'smtp.gmail.com',
        ssl: true,
    });

However, when doing so, I get an error

Attempted import error: 'SMTPClient' is not exported from 'emailjs'.

Does anybody have any idea why I am facing this?

eleith commented 3 years ago

emailjs is a server side only library. if you are using it within react, it seems like you might be trying to use it client side.