1. Products
  2.   Email
  3.   C++
  4.   MailCore 2
 
  

Open Source C++ Library to Create & Manage Email Messages

Free C++ API for Emails Generation & Management. It Supports Sending Email Sessages, Manage a List of Addresses, Add Attachments, Audio Attachment , Encode Email Messages, and many more.

In today's interconnected world, email communication remains a cornerstone of both personal and professional interactions. For developers, working with email functionality in applications can be a challenging task due to the complexities of different email protocols and standards. Fortunately, the MailCore 2 library comes to the rescue, providing a reliable and straightforward solution for handling emails in various programming languages. Security is a top priority when dealing with email and the library ensures secure connections through SSL/TLS protocols, safeguarding sensitive data during transmission.

MailCore 2 is an open-source library that provides a cross-platform API for handling email protocols like IMAP, SMTP, and POP3. Created by a team of talented developers, the library aims to make email integration seamless for application developers. Whether users need to retrieve emails, send messages, or manage email accounts, it offers a comprehensive set of tools to simplify these tasks. The library is written in C++ with bindings available for various programming languages, such as Swift, Objective-C, and Python.

MailCore 2 is a powerful, versatile, and well-maintained library that simplifies email handling for developers across different platforms and programming languages. The library makes it straightforward to send emails programmatically using SMTP. It offers thread management functionality, helping developers organize emails into meaningful conversations for a better user experience. The library boasts a comprehensive documentation repository, empowering developers to understand its capabilities and implement it efficiently. Whether you're building an email client, a notification system, or anything in between, MailCore 2 is an invaluable tool that deserves a place in your development toolkit.

Previous Next

Getting Started with MailCore 2

The recommend way to install MailCore 2 is using GitHub. Please use the following command for a smooth installation.

Install MailCore 2 via GitHub

go get https://github.com/MailCore/mailcore2.git

Message Parsing Support inside C++ Apps

The open source MailCore 2 library has provided several important features for handling email message parsing inside C++ applications. The library simplifies the parsing of email messages, allowing software developers to extract essential information such as sender, recipient, subject, body, attachments, and more. This feature streamlines the process of handling incoming emails and responding appropriately. The following example demonstrates how software developers can retrieve email messages using C++ library.

How to Retrieve Email Messages using C++ Code?

import MailCore
// Initialize the mail client
let mailClient = CTCoreAccount()
// Set up the server details and authentication credentials
let server = "imap.example.com"
let username = "your_email@example.com"
let password = "your_password"
// Connect to the email server
mailClient.connectToServer(server, port: 993, connectionType: .TLS)
mailClient.login(username, password: password)
// Fetch inbox messages
let inboxFolder = mailClient.folderWithPath("INBOX")
let messages = inboxFolder?.messages()
// Display email subjects
for message in messages ?? [] {
    print(message.subject())
}
// Disconnect from the server
mailClient.disconnect()

Unified Email Protocol Support

The open source MailCore 2 library has provided complete support for the most widely used email protocols. The library supports popular email protocols, including IMAP, SMTP, POP3 and many more. Software Developers can seamlessly integrate email functionalities into their applications without worrying about underlying protocol intricacies. The following example shows how software developers can update the flags for a message inside C++ applications.

How to Update Flags for Message inside C++ applications?

BOOL deleted = NEW_FLAGS & MCOMessageFlagDeleted;
        
        MCOIMAPOperation *op = [session storeFlagsOperationWithFolder:@"INBOX"
                                                                 uids:[MCOIndexSet indexSetWithIndex:MESSAGE_UID]
                                                                 kind:MCOIMAPStoreFlagsRequestKindSet
                                                                flags:NEW_FLAGS];
        [op start:^(NSError * error) {
            if(!error) {
                NSLog(@"Updated flags!");
            } else {
                NSLog(@"Error updating flags:%@", error);
            }
            
            if(deleted) {
                MCOIMAPOperation *deleteOp = [session expungeOperation:@"INBOX"];
                [deleteOp start:^(NSError *error) {
                    if(error) {
                        NSLog(@"Error expunging folder:%@", error);
                    } else {
                        NSLog(@"Successfully expunged folder");
                    }
                }];
            }
        }];

Secure Authentication & Multi-Language Support

The open source MailCore 2 library takes security seriously. It provides secure authentication mechanisms for connecting to email servers, ensuring that sensitive information remains protected throughout the communication process. Moreover, the library supports multiple programming languages, making it accessible to a broader range of developers. Whether you prefer Objective-C, Swift, C++, or any other supported language, MailCore 2 has you covered.