Microsoft 365: Send Emails
We know the importance of sending emails, and the fact that it’s a common task in today’s applications. Many people working with Office 365 have asked us for an API to send emails via the Microsoft Graph API. The OAuth 2.0 feature was a prerequisite for connecting to the Microsoft server and for introducing commands to retrieve user information. We are glad to proceed with email management, starting with the send email command.
4D and Microsoft 365 access
In the 4D v18 R6, 4D introduced OAuth 2.0 authentication to access emails through IMAP, SMTP, or POP3 transporters. Starting with 4D v19 R3, 4D continues to implement OAuth 2.0 protocol and provides a way to request easily by programming a token from the Microsoft identity platform to connect to the API for Microsoft 365.
Create, delete, and rename mailboxes with IMAP
The Mail feature, a huge feature set. The first part was released with 4D v17 R4, and since then we have delivered more and more functionalities.
4D v19 is no exception, as it brings new functions to help you manage your mailboxes by programming. That includes creating, renaming, and deleting mailboxes. A mailbox is displayed as a folder in email clients such as Microsoft Outlook or Apple Mail.
Manage IMAP flags
To allow your solution to smoothly integrate with other email clients, you often need to add information such as “already seen” or “urgent”. The IMAP protocol allows you to associate a list of flags with a message to manage this additional information. 4D v18 R6 includes a set of functions for the IMAP Transporter object to add or remove IMAP flags.
Save emails in a specific mailbox
When you send emails from 4D, your customers might expect to get a copy in the “Sent” mailbox displayed by Outlook or Apple Mail. For this, 4D v18 R6 has a new command for you. Say hello to the new IMAP transporter append() function.
Connect your mail transporters with an OAuth 2.0 token
Lately, email servers on the web have started to move to OAuth 2.0 authentication to increase security. Starting with 4D v18 R6, 4D provides a way to set the OAuth 2.0 authentication mode of a connection. Keep reading for the details!
Copy, move, and delete emails with IMAP
Sometimes you need to save certain emails in dedicated mailboxes and other times you want to delete certain emails to keep up your INBOX tidy. The three new functions we’ve added to the IMAP transporter, copy(), move(), and delete() make this a breeze!
Search emails with IMAP protocol
Sometimes you need to find all of the unread emails on your mail server and download them to display them to your client. The searchMails method does it for you! It uses the IMAP search protocol which is done entirely on the server-side. This means that it’s fast and allows you to retrieve only the desired emails.
4D Webinar – 4D Write Pro: Create a Lightweight Email Composer
Even during the lockdown, 4D continued to foster a sense of community through engaging content, interactive communications, and virtual gatherings such as webinars.
If you haven’t noticed, many of the 4D webinars presented by Will Taylor (Technical Account Manager, 4D US) have been made public on our Youtube channel.
The most recent one is related to 4D Write Pro and how you can create a lightweight email composer:
Receive email with IMAP protocol
In 4D v18, we introduced a new way to send emails. Then in 4D v18 R2, we added a new way to retrieve emails using POP3. Now in 4D v18 R4, we’re taking the first steps for a new way to handle the IMAP protocol. As we did for SMTP and POP3, there’s a new IMAP New transporter command to handle the IMAP protocol.
The Internet Message Access Protocol (IMAP) is an Internet standard protocol used by email clients to retrieve email messages from a mail server. This protocol makes it possible to manage multiple mailboxes, download emails, perform searches on the server, manage message state, and a lot more!
And with this first IMAP feature, you can add methods to the transporter to: have the list of the available mailboxes, select a mailbox, and receive email from the selected mailbox. Let’s see how.
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy