Engineering Core
ISB Vietnam's skilled software engineers deliver high-quality applications, leveraging their extensive experience in developing financial tools, business management systems, medical technology, and mobile/web platforms.
As a programmer, we are probably too familiar with handling sending emails for our application.
How you can send a meeting invite from your own application that works perfectly with Google Calendar, Outlook, and Apple Calendar?
Today I will introduce about sending emails to invite to events and that event will be added to your calendar. We'll break down what iCalendar and .ics files are, how they work, and how you can use Node.js to send your own calendar invitations that show up with those professional "Yes / No / Maybe" buttons.

I. What is iCalendar?

iCalendar is a standard format for sharing calendar information between different applications. You may have used Google Calendar, Outlook, or Apple Calendar before — iCalendar is what helps these apps “speak” to each other when sharing event details. The format is widely used because it follows a consistent structure that all calendar software can understand.
The iCalendar format makes it easy to share event data like meetings, appointments, birthdays, or even reminders. For example, when you receive an event invitation in your email and click “Add to Calendar,” that’s usually an iCalendar file at work. This file contains all the event details such as date, time, title, and location, allowing your calendar app to automatically add the event to your schedule. The iCalendar format uses a .ics file extension — short for “iCalendar file.” It is human-readable and simple to create or modify, making it very useful for developers who want to add calendar features to their applications.

II. What is an ICS File?

An ICS file is a plain text file that follows the iCalendar format. It contains all the information needed for calendar events. You can open it with a text editor to see its content or import it into any calendar app.
When working with an ICS file, there are several key components you’ll usually find:
  • BEGIN:VCALENDAR and END:VCALENDAR: These mark the start and end of the calendar file.
  • VERSION: This indicates the version of iCalendar being used (commonly “2.0”).
  • PRODID: Identifies the application that created the ICS file.
  • BEGIN:VEVENT and END:VEVENT: These mark the start and end of an event block.
  • UID: A unique identifier for the event. It helps distinguish one event from another.
  • DTSTAMP: The date and time when the event file was created or last modified.
  • DTSTART and DTEND: Define the start and end times of the event.
  • SUMMARY: The title or short description of the event.
  • LOCATION: The place where the event will happen.
  • STATUS: Shows whether the event is confirmed, tentative, or cancelled.
  • DESCRIPTION: More details about the event.
  • ORGANIZER and ATTENDEE: Information about who is organizing the event and who is invited.

    Example of an ICS event:

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//IVC System//Meeting Scheduler//EN
    CALSCALE:GREGORIAN
    METHOD:REQUEST
    BEGIN:VEVENT
    UID:20251124T183309Z
    DTSTAMP:20251124T113309Z
    DTSTART:20251124T114000Z
    DTEND:20251124T121000Z
    SUMMARY:Team meeting
    DESCRIPTION:Monthly team meeting to discuss progress and goals.
    LOCATION:Meeting Room 2
    SEQUENCE:0
    STATUS:CONFIRMED
    ORGANIZER;CN="admin@example.com":mailto:admin@example.com
    ATTENDEE;PARTSTAT=ACCEPTED;RSVP=FALSE;CN=user1@example.com:mailto:user1@example.com
    END:VEVENT
    END:VCALENDAR

III. Points to note when working with ICS:

Always Use UTC Time: Notice the Z at the end of all the timestamps (e.g., ...T100000Z)? This signifies UTC (Coordinated Universal Time). This is a critical best practice. Don't worry about timezones; just provide the event time in UTC. The user's calendar application (Google, Outlook) will automatically and correctly translate it to their local timezone.
UID is Forever: The UID is the event's permanent ID. If you send 10 emails with 10 different .ics files but they all have the same UID, the calendar app will just update the one event.

IV. How to create a new event

To create a new event, you generate an .ics file with:
  • A brand new, unique UID that has never been used before.
  • A SEQUENCE: 0 property.

V. How to update an Event

This is where UID and SEQUENCE are crucial. Imagine you need to move the meeting from 2:00 PM to 3:00 PM. You would send a new .ics file via a new email, but inside the file, you would:
Use the exact same UID as the original event (12345-abc-67890@my-domain.com).
Increment the SEQUENCE number (e.g., SEQUENCE:1).
Update the changed fields (e.g., DTSTART:20251126T150000Z and DTEND:20251126T160000Z).
Update the DTSTAMP to the current time.
When the user's calendar receives this, it sees the UID, finds the event it already has, and checks the SEQUENCE. Since 1 is greater than 0, it knows this is an update and applies the changes. If you send an update with the same SEQUENCE number, it will be ignored as a duplicate.

VI. Sending ICS Mail with Node.js

Manually writing .ics files is a pain. Luckily, we can use libraries to do the hard work. Here’s how to generate an event and email it as a real invitation (with the "Yes/No/Maybe" buttons) using two popular npm packages: ics and nodemailer.
First, install the libraries:
npm install ics nodemailer
Now, let's write the Node.js script.
constnodemailer=require("nodemailer");

 

consttransporter=nodemailer.createTransport({
    service:"gmail",
    auth: {
        user:"your_email@gmail.com",
        pass:"your_password"
    }
});

 

consticsContent=`
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//IVC System//Meeting Scheduler//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
UID:20251124T183309Z
DTSTAMP:20251124T113309Z
DTSTART:20251124T114000Z
DTEND:20251124T121000Z
SUMMARY:Team meeting
DESCRIPTION:Monthly team meeting to discuss progress and goals.
LOCATION:Meeting Room 2
SEQUENCE:0
STATUS:CONFIRMED
ORGANIZER;CN="admin@example.com":mailto:admin@example.com
ATTENDEE;PARTSTAT=ACCEPTED;RSVP=FALSE;CN=user1@example.com:mailto:user1@example.com
END:VEVENT
END:VCALENDAR
`;

 

constmailOptions= {
    from:"your_email@gmail.com",
    to:"recipient@example.com",
    subject:"Meeting Invitation",
    text:"Please find the meeting invitation attached.",
    alternatives: [
        {
            contentType:"text/calendar; charset=\"utf-8\"; method=REQUEST",
            content:icsContent
        }
    ]
};

 

transporter.sendMail(mailOptions, (error, info) => {
    if (error) {
        console.log(error);
    } else {
        console.log("Email sent: "+info.response);
    }
});

VII. Conclusion

Working with ICS files is a simple yet powerful way to integrate calendar functionality into your applications. By understanding the basic structure of iCalendar and how an ICS file works, you can easily create, update, and share events between users. When combined with email tools like Nodemailer in Node.js, sending meeting invitations becomes automatic and seamless.
This feature is especially useful for apps that schedule appointments, meetings, or events — such as booking systems, team collaboration tools, and online learning platforms.
In short, iCalendar and ICS make it possible for different platforms and users to stay connected and organized, regardless of which calendar service they use. With just a bit of code, you can help users save time and never miss an important event again.
Whether you need scalable software solutions, expert IT outsourcing, or a long-term development partner, ISB Vietnam is here to deliver. Let's build something great together- reach out to us today. Or click here to explore more ISB Vietnam's case studies
[References]
Written by
Author Avatar
Engineering Core
ISB Vietnam's skilled software engineers deliver high-quality applications, leveraging their extensive experience in developing financial tools, business management systems, medical technology, and mobile/web platforms.

COMPANY PROFILE

Please check out our Company Profile.

Download

COMPANY PORTFOLIO

Explore my work!

Download

ASK ISB Vietnam ABOUT DEVELOPMENT

Let's talk about your project!

Contact US