Skip to content

Instantly share code, notes, and snippets.

@tiagofrancafernandes
Forked from CViniciusSDias/ler-emails.php
Created June 26, 2023 02:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagofrancafernandes/f502bfe15c5e71d0be5902828bf09e90 to your computer and use it in GitHub Desktop.
Save tiagofrancafernandes/f502bfe15c5e71d0be5902828bf09e90 to your computer and use it in GitHub Desktop.
Script para ler e-mails em voz alta usando PHP
<?php
use PhpImap\Mailbox;
require_once 'vendor/autoload.php';
$mailbox = new Mailbox(
'{imap.gmail.com:993/imap/ssl}INBOX',
'seu-email@gmail.com',
'sua senha aqui',
);
$mailIds = $mailbox
->searchMailbox('UNSEEN FROM "newsletter@filipedeschamps.com.br"');
foreach ($mailIds as $mailId) {
$mail = $mailbox->getMail($mailId);
createSpeaker()->speak($mail->textPlain);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment