# @mozeyinedu/email

> send and receive email package using gmail service

Latest version **2.0.0** (published 2022-07-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install @mozeyinedu/email
pnpm add @mozeyinedu/email
yarn add @mozeyinedu/email
bun add @mozeyinedu/email
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-07-13 |
| First published | 2022-06-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 (+22 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | mozey |
| Maintainers | mozeyinedu |
| Keywords | send, email, receive, email, nodmailer, mailgun, smtp, gmail-service |

## Links

- npm: https://www.npmjs.com/package/@mozeyinedu/email
- Repository: https://github.com/inedumozey/email
- Homepage: https://github.com/inedumozey/email#readme
- Issues: https://github.com/inedumozey/email/issues
- npm.io page: https://npm.io/package/@mozeyinedu/email

## Dependencies (2)

- [nodemailer](https://npm.io/package/nodemailer.md) ^6.7.5
- [nodemailer-mailgun-transport](https://npm.io/package/nodemailer-mailgun-transport.md) ^2.1.4

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2022-07-13
- 1.0.1 — 2022-06-24
- 1.0.0 — 2022-06-24
- 0.1.0 — 2022-06-24

## README

* Emailing using smtp server, nodemailer and mailgun
* send emails
* receive emails

*** Usage

** Send Emails

1. Get your smtp host, (for some private emails, host: email.privateemail.com), for gmail, it is smtp.gmail.com. for Outlook, it is smtp-mail.outlook.com. for Hotmail, it is smtp.live.com or smtp.office365.com. Default here is set to smtp.gmail.com for gmail users.

2. port (can be 465 for SSL or 587 for TLS). Default here is set to be 465

3. secure (true or false). Default here is set to be true

4. Your email username

5. Your email password

*** Steps to send in gmail as google do not allowed your email password, it requires special configuration as shown below.

1. Go to your Google account at https://myaccount.google.com/
2. Go to Security
3. In "Signing in to Google" section choose 2-Step Verification - here you have to verify yourself, in my case it was with phone number and a confirmation code send as text message. After that you will be able to enabled 2-Step Verification
4. Back to Security in "Signing in to Google" section choose App passwords
5. From the Select app drop down choose Other (Custom name) and put a name e.g. nodemailer
6. A modal dialog will appear with the password. Get that password and use it in your  as seen below.

If there is still a problem, try clearing captcha by visiting https://accounts.google.com/DisplayUnlockCaptcha from your Google account.


```
    const Email = require('@mozeyinedu/email');

    const email = new Email({
        user: process.env.USER,
        pass: process.env.PASS,
        host: 'mail.privateemail.com',
        port: '465',
        secure: true,
    });

    email.send({
        from: process.env.USER,
        to: 'example@gmail.com',
        subject: 'Test',
        html: `<h1>testing</h1>`,
    }, 

    (err, res)=>{
        if(err){
            console.log(err)
        }
        else{
            console.log(res)
        }
    });

```



** Receive Emails

---
_Source: https://npm.io/package/@mozeyinedu/email · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
