๐Ÿ“ง Layanan pengirim pesan elektronik (email) dengan API.

Overview

๐Ÿ“ง Fimail

Visitor GitHub deployments

Fimail, layanan pengirim pesan elektronik dengan API. Dibuat dengan โค dan NodeJs oleh Feri Irawan pada 31/12/2021 06.27

โšก Memulai Cepat

Berikut ini contoh sederhana permintaan API untuk memulai cepat.

", "address": " " }, "to": { "name": " ", "address": " " }, "subject": "Fimail - Simple Mail", "contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit." }'">
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:

", "address": " " }, "to": [ { "name": " ", "address": " " }, { "name": " ", "address": " " }, { "name": " ", "address": " " }, ], "subject": "Fimail - Multiple Receptions", "contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit." }'">
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:

", "to": "\"Reception 1\" ,\"Reception 2\" ,\"Reception 3\" ", // Or "from": "[email protected]", "to": "[email protected],[email protected],[email protected]" }">
{
    "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.

", "address": " " }, "to": { "name": " ", "address": " " }, "subject": "Fimail - HTML Mail", "contents": " Lorem ipsum dolor sit amet consectetur adipisicing elit." }'">
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:

", "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" } }'">
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:

", "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=" } }'">
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:

", "address": " " }, "to": { "name": " ", "address": " " }, "subject": "Fimail - With Attachments", "contents": "Lorem ipsum dolor sit amet consectetur adipisicing elit.", "attachments: { "filename": "mytext.txt", "content": " " } }'">
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.

", "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!" } ] }'">
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.

You might also like...

This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my initial appointment date. It doesn't handle rescheduling.

This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my initial appointment date. It doesn't handle rescheduling.

US-visa-appointment-notifier This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my in

Jan 4, 2023

๐Ÿ’Œ A simple contact form that helps people send you a message. ๐Ÿ“ฉ to your email. - built with JavaScript/Nodemailer ๐Ÿ“ƒ

Implementation using async/await: app.js const contactForm = document.querySelector(".contact-form"); let name = document.getElementById("name"); let

Aug 17, 2022

A simple easy to use vanilla JavaScript library for creating input fields that accept multiple email addresses

MeiMei - Multiple Email Input MeiMei: A simple easy to use vanilla JavaScript library for creating input fields that accept multiple email addresses.

Apr 13, 2022

Simple email automation library for Node.js

Dakiya Simple email automation for Node.js made easy. Features Zero config management: Use simple, chainable code to create email sequences. Email pla

Sep 22, 2022

Mute email noise from people you don't know.

All the love to supporters โค๏ธ You are fantastic if you're using emailgurus.xyz. Thank you so much for your support. Welcome to Emailgurus! Hi! Here is

Oct 28, 2022

Little Javascript / Typescript library for validating format of string like email, url, password...

String-Validators Little Javascript / Typescript library for validating format of string like email, url, password... Signaler un Bug ยท Proposer une F

Oct 14, 2022

A Weather API project inspired by The Ultimate API Challenge / Weather API.

Weather API Project A Weather API project inspired by The Ultimate API Challenge / Weather API. Tech Stack: React.js Tailwind Axios Inspiration The Pr

Dec 29, 2021

This project is built with JavaScript, Webpack, HTML & CSS, Leaderboard api. When user clicks on Refresh button it hits the api and responds with the data, The user can also post data to the api

This project is built with JavaScript, Webpack, HTML & CSS, Leaderboard api. When user clicks on Refresh button it hits the api and responds with the data, The user can also post data to the api

leaderboad Description the project. this project is about the leaderboad i did during Microverse to build a website for adding Data to the API and fet

May 30, 2022

Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services.

Tidbyt Client for Node.js Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services. Insta

Dec 17, 2022
Owner
Feri Irawan
Bismillahirahmanirahim.
Feri Irawan
A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email.

Strapi PasswordLess Plugin A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email. A pl

Andrey Kucherenko 51 Dec 12, 2022
A free simple responsive HTML email template

Free Responsive HTML Email Template Sometimes all you want is a really simple responsive HTML email template with a clear call-to-action button. Here

Lee Munroe 11.8k Dec 30, 2022
Demodal is a browser extension that automatically removes content blocking modals including paywalls, discount offers, promts to sign up or enter your email address and more.

Demodal Demodal is a browser extension that automatically removes content blocking modals including paywalls, discount offers, promts to sign up or en

Elbert Alias 225 Jan 4, 2023
This is an unofficial front end for Hacker News, reminiscent of the Windows XP era Outlook email client on a Windows XP default desktop

Hacker XP Hacker News styled as the Windows XP Outlook email client. Try out Hacker XP here! Description This is an unofficial front end for Hacker Ne

null 19 Jul 12, 2022
LucaMail - an Open Source,Cross Platform Email Client

LucaMail v0.0.1-beta An Awesome Cross Platform Email Client! Note : This Project Is Still in Beta Version Website . Report Bug . Request Feature . Dis

Yuva raghav 210 Dec 28, 2022
Plugin for Obsidian.md to send markdown notes to Buttondown.email

Obsidian Buttondown Plugin Buttondown is a tool for producing email newsletters. It likes emails written in Markdown, and has an API. This plugin allo

Caro 4 Nov 15, 2022
This is email scheduler made using MERN. This repo contains server code, client repo is linked in readme.

Email Scheduler Client This is an email scheduler server (client in different repository). It is made using node.js/express.js. Overview User can sign

Sai Charan 2 Dec 3, 2022
This is an email scheduler made using MERN stack. This repo contains client, server side is linked in readme

Email Scheduler Client This is an email scheduler client (server in different repository). It is made using react. Overview User can sign-up/sign-in,

Sai Charan 3 Dec 3, 2022
๐Ÿ“ฌ A quick comparison of private and / or secure email providers

?? Email Comparison A comparison table of private and / or secure email providers Live App The app can be accessed at: lissy93.github.io/email-compari

Alicia Sykes 47 Dec 15, 2022
Reduce misspelled email addresses in your web apps.

mailcheck.js The Javascript library and jQuery plugin that suggests a right domain when your users misspell it in an email address. mailcheck.js is pa

mailcheck 7.9k Dec 28, 2022