Created
May 19, 2021 15:21
-
-
Save ahmetgungor/541b20f597a2d3b551810ea6173cbfd9 to your computer and use it in GitHub Desktop.
php ile yandex mail okuma - en basit hali
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 | |
if(function_exists("imap_open")) | |
{ | |
$imapPath = '{imap.yandex.com.tr:993/imap/ssl}INBOX'; | |
$username = ''; | |
$password = ''; | |
$inbox = imap_open($imapPath,$username,$password) or die('Cannot connect to yandex: ' . imap_last_error()); | |
$emails = imap_search($inbox,'UNSEEN'); // okunmamış epostları göster https://www.php.net/manual/tr/function.imap-search.php | |
foreach($emails as $mail) | |
{ | |
// $headerInfo = imap_headerinfo($inbox,$mail); | |
echo (imap_body($inbox, $mail, FT_PEEK)); | |
} | |
}else{ | |
echo "imap modülü etkin değil"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment