You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const path = require("path");
const gmail = require("gmail-tester");
const email = await gmail.check_inbox(
path.resolve(__dirname, "credentials.json"), // Assuming credentials.json is in the current directory.
path.resolve(__dirname, "gmail_token.json"), // Look for gmail_token.json in the current directory (if it doesn't exists, it will be created by the script).
"Activate Your Account", // We are looking for 'Activate Your Account' in the subject of the message.
"[email protected]", // We are looking for a sender header which has '[email protected]' in it.
"<target-email>", // Which inbox to poll. credentials.json should contain the credentials to it.
10, // Poll interval (in seconds).
30 // Maximum poll time (in seconds), after which we'll giveup.
{ include_body: true } // If we want to include the body of messages (optional)
]
);
if (email) {
console.log("Email was found!");
} else {
console.log("Email was not found!");
}
this code wont works, a comma is missing after 30 and the square brackets should to be a brackets after { include_body: true }
const path = require("path");
const gmail = require("gmail-tester");
const email = await gmail.check_inbox(
path.resolve(__dirname, "credentials.json"), // Assuming credentials.json is in the current directory.
path.resolve(__dirname, "gmail_token.json"), // Look for gmail_token.json in the current directory (if it doesn't exists, it will be created by the script).
"Activate Your Account", // We are looking for 'Activate Your Account' in the subject of the message.
"[email protected]", // We are looking for a sender header which has '[email protected]' in it.
"<target-email>", // Which inbox to poll. credentials.json should contain the credentials to it.
10, // Poll interval (in seconds).
30, // Maximum poll time (in seconds), after which we'll giveup.
{ include_body: true } // If we want to include the body of messages (optional)
)
);
if (email) {
console.log("Email was found!");
} else {
console.log("Email was not found!");
}
the check_inbox example here https://github.com/levz0r/gmail-tester
this code wont works, a comma is missing after 30 and the square brackets should to be a brackets after { include_body: true }
also,
in the documentation of check_inbox
https://github.com/levz0r/gmail-tester#check_inboxcredentials_json-token_path-subject-from-to-wait_time_sec--30-max_wait_time_sec--60-options--
subject , from and to are exact match but in the example they aren't, because comments says "IN IT"
The text was updated successfully, but these errors were encountered: