Last active
February 23, 2024 18:33
-
-
Save CViniciusSDias/e669bfe04097545068870cb33e067413 to your computer and use it in GitHub Desktop.
Script para ler e-mails em voz alta usando PHP
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
<?php | |
use PhpImap\Mailbox; | |
require_once 'vendor/autoload.php'; | |
$mailbox = new Mailbox( | |
'{imap.gmail.com:993/imap/ssl}INBOX', | |
'[email protected]', | |
'sua senha aqui', | |
); | |
$mailIds = $mailbox | |
->searchMailbox('UNSEEN FROM "[email protected]"'); | |
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