Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/feri-irawan/fimail
📧 Layanan pengirim pesan elektronik (email) dengan API.
https://github.com/feri-irawan/fimail
fimail gmail javascript mail mailer nodemailer open-source project sendmail sendmailer smtp
Last synced: about 1 month ago
JSON representation
📧 Layanan pengirim pesan elektronik (email) dengan API.
- Host: GitHub
- URL: https://github.com/feri-irawan/fimail
- Owner: feri-irawan
- Created: 2022-01-09T07:04:45.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-24T15:22:14.000Z (almost 3 years ago)
- Last Synced: 2024-01-28T23:11:36.525Z (11 months ago)
- Topics: fimail, gmail, javascript, mail, mailer, nodemailer, open-source, project, sendmail, sendmailer, smtp
- Language: JavaScript
- Homepage: https://fimail.vercel.app
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-made-by-indonesian - Fimail - `Layanan pengirim pesan elektronik (email) dengan API.` *by [Feri Irawan](https://github.com/feri-irawan)* (F)
- made-in-indonesia - Fimail - `Layanan pengirim pesan elektronik (email) dengan API.` *by [Feri Irawan](https://github.com/feri-irawan)* (F)
README
# 📧 Fimail
![Visitor](https://fibadge.vercel.app/badges/visitors/feri-irawan/fimail)
![GitHub deployments](https://img.shields.io/github/deployments/feri-irawan/fimail/production?label=vercel&logo=vercel&style=for-the-badge)Fimail, layanan pengirim pesan elektronik dengan API. Dibuat dengan ❤ dan NodeJs oleh [Feri Irawan](https://github.com/feri-irawan) pada 31/12/2021 06.27
## ⚡ Memulai Cepat
Berikut ini contoh sederhana permintaan API untuk memulai cepat.
```bash
curl -X POST 'https://fimail.vercel.app/send' \
-H 'Content-Type: application/json' \
-d '{
"from": {
"name": "",
"address": ""
},
"to": {
"name": "",
"address": ""
},
"subject": "Fimail - Simple Mail",
"contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
}'
```## 👥 Multi Pengguna
Jika kamu ingin mengirim ke beberapa pengguna, kamu bisa menuliskan email pengguna-pengguna dalam bentuk *array*.
**Contoh:**
```bash
curl -X POST 'https://fimail.vercel.app/send' \
-H 'Content-Type: application/json' \
-d '{
"from": {
"name": "",
"address": ""
},
"to": [
{
"name": "",
"address": ""
},
{
"name": "",
"address": ""
},
{
"name": "",
"address": ""
},
],
"subject": "Fimail - Multiple Receptions",
"contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
}'
```Informasi pengirim dan penerima (`to`, `cc`, `bc`, dan `bcc`) juga boleh ditulis seperti ini:
```jsonc
{
"from": "\"My Name\" ",
"to": "\"Reception 1\" ,\"Reception 2\" ,\"Reception 3\" ",
// Or"from": "[email protected]",
"to": "[email protected],[email protected],[email protected]"
}
```## 👩🏻💻 Konten HTML
Secara default pesan yang dikirim sudah dalam format HTML, jadi kamu ingin mengirim konten berupa kode HTML, maka kamu bisa langsung menuliskannya seperti berikut.
```bash
curl -X POST 'https://fimail.vercel.app/send' \
-H 'Content-Type: application/json' \
-d '{
"from": {
"name": "",
"address": ""
},
"to": {
"name": "",
"address": ""
},
"subject": "Fimail - HTML Mail",
"contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit."
}'
```## 📎 Dengan Lampiran
Kamu juga bisa mengirim lampiran seperti file, gambar dengan cara menambahkan properti `attachments` pada body.
### 🌐 Menggunakan URL atau URI Base64
Kamu bisa mengirimkan lampiran yang kontenya diambil dari URL atau base64, seperti berikut.
**Contoh 1 - Menggunakan URL:**
```bash
curl -X POST 'https://fimail.vercel.app/send' \
-H 'Content-Type: application/json' \
-d '{
"from": {
"name": "",
"address": ""
},
"to": {
"name": "",
"address": ""
},
"subject": "Fimail - With Attachments",
"contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"attachments: {
"filename": "myimage.jpg",
"path": "https://dummyimage.com/400x400/00ffbf/000000.jpg"
}
}'
```**Contoh 2 - Menggunakan URI Base64:**
```bash
curl -X POST 'https://fimail.vercel.app/send' \
-H 'Content-Type: application/json' \
-d '{
"from": {
"name": "",
"address": ""
},
"to": {
"name": "",
"address": ""
},
"subject": "Fimail - With Attachments",
"contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"attachments: {
"filename": "myimage.jpg",
"path": "data:text/plain;base64,aGVsbG8gd29ybGQ="
}
}'
```### 👩🏻💻 Menggunakan String, Buffer, Stream
Kamu juga bisa mengirimkan lampiran yang kontennya berupa *string*, *buffer*, atau *stream*.
**Contoh:**
```bash
curl -X POST 'https://fimail.vercel.app/send' \
-H 'Content-Type: application/json' \
-d '{
"from": {
"name": "",
"address": ""
},
"to": {
"name": "",
"address": ""
},
"subject": "Fimail - With Attachments",
"contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"attachments: {
"filename": "mytext.txt",
"content": ""
}
}'
```Jika kontennya diambil dari ***buffer*** atau ***stream*** maka, kamu bisa melukan hal yang sama seperti contoh di atas ini.
### 🖇 Multi Lampiran
Kamu juga bisa mengirim beberapa lampiran dengan cara menyusunnya ke dalam bentuk *array* seperti berikut ini.
```bash
curl -X POST 'https://fimail.vercel.app/send' \
-H 'Content-Type: application/json' \
-d '{
"from": {
"name": "",
"address": ""
},
"to": {
"name": "",
"address": ""
},
"subject": "Fimail - With Attachments",
"contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
"attachments: [
{
"filename": "myimage.jpg",
"path": "https://dummyimage.com/400x400/00ffbf/000000.jpg"
},
{
"filename": "myimage2.jpg",
"path": "https://dummyimage.com/400x400/ffd000/000000.jpg"
},
{
"filename": "mytext.txt",
"content": "Hello World!"
}
]
}'
```Nah, seperti itulah cara melakukan permintaan API ke Fimail untuk mengirim email.
Semoga bermanfaat, terima kasih.