SendMail is a utility that allows for sending emails via SMTP protocol.
This package allows you to configure and send emails using SMTP. It is designed to be simple and efficient, making it ideal for integrating email functionalities within your applications.
Ensure you have Node.js installed on your system to use this package. You can download it from nodejs.org.
This package is hosted on a private npm registry. Ensure you have access and configure npm to use it. Typically, you would install it with:
npm install @private/send_mail
Follow these steps to configure the SendMail utility:
-
Set SMTP Access Set the SMTP server details:
Mailer.setSMTP('hostname', 587, true);
-
User Credentials Configure your SMTP authentication details:
Mailer.setUserCredentials('your@email.com', 'password');
-
Set Sender Define the sender's name and email address:
Mailer.setSender('Sender', 'your@email.com');
-
Set Recipient Specify the recipient's email address:
Mailer.setSendTo('recipien@email.com');
-
Set Email Subject Set the subject of the email:
Mailer.setSubject('It Works');
-
Set Email Body Define the body content of the email:
Mailer.setBody('It Works Body too');
-
Send Email Send the email:
Mailer.send().then(a => { console.log('Email sent successfully!'); }).catch(error => { console.error('Failed to send email:', error); });
For developers interested in contributing or modifying the package, the following files are critical:
- webpack.config.js: Configures the module bundling and build processes.
- tsconfig.json: Manages TypeScript compilation settings.
- package.json: Contains all metadata and dependencies necessary for the project.
This project is licensed under the ISC License. See the LICENSE file for more details.
- Marcus Woyciechowski