Skip to content

Instantly share code, notes, and snippets.

@CViniciusSDias
Last active February 23, 2024 18:33
Show Gist options
  • Save CViniciusSDias/e669bfe04097545068870cb33e067413 to your computer and use it in GitHub Desktop.
Save CViniciusSDias/e669bfe04097545068870cb33e067413 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