This repository has been archived by the owner on Jan 10, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to set, add and remove flags
- Loading branch information
Showing
6 changed files
with
620 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Created by K. Suwatchai (Mobizt) | ||
* | ||
* Email: k_suwatchai@hotmail.com | ||
* | ||
* Github: https://github.com/mobizt | ||
* | ||
* Copyright (c) 2019 mobizt | ||
* | ||
*/ | ||
|
||
|
||
#include <Arduino.h> | ||
#include "ESP32_MailClient.h" | ||
|
||
#define WIFI_SSID "YOUR_WIFI_SSID" | ||
#define WIFI_PASSWORD "YOUR_WIFI_PASSWORD" | ||
|
||
//The Email Reading data object contains config and data that received | ||
IMAPData imapData; | ||
|
||
void readEmail(); | ||
|
||
unsigned long lastTime = 0; | ||
|
||
void setup() | ||
{ | ||
|
||
Serial.begin(115200); | ||
Serial.println(); | ||
|
||
Serial.print("Connecting to AP"); | ||
|
||
WiFi.begin(WIFI_SSID, WIFI_PASSWORD); | ||
while (WiFi.status() != WL_CONNECTED) | ||
{ | ||
Serial.print("."); | ||
delay(200); | ||
} | ||
|
||
Serial.println(""); | ||
Serial.println("WiFi connected."); | ||
Serial.println("IP address: "); | ||
Serial.println(WiFi.localIP()); | ||
|
||
Serial.println(); | ||
|
||
Serial.println(); | ||
|
||
imapData.setLogin("imap.gmail.com", 993, "YOUR_EMAIL_ACCOUNT@gmail.com", "YOUR_EMAIL_PASSWORD"); | ||
imapData.setFolder("INBOX"); | ||
imapData.setDebug(true); | ||
|
||
//Set \Seen and \Answered to flags for message with UID 100 | ||
MailClient.setFlag(imapData, 100, "\\Seen \\Answered"); | ||
|
||
//Add \Seen and \Answered to flags for message with UID 100 | ||
//MailClient.addFlag(imapData, 100, "\\Seen \\Answered"); | ||
|
||
//Remove \Seen and \Answered from flags for message with UID 100 | ||
//MailClient.removeFlag(imapData, 100, "\\Seen \\Answered"); | ||
} | ||
|
||
|
||
|
||
void loop() | ||
{ | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name=ESP32 Mail Client | ||
|
||
version=2.0.5 | ||
version=2.0.6 | ||
|
||
author=Mobizt | ||
|
||
|
Oops, something went wrong.