Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmetgungor/541b20f597a2d3b551810ea6173cbfd9 to your computer and use it in GitHub Desktop.
Save ahmetgungor/541b20f597a2d3b551810ea6173cbfd9 to your computer and use it in GitHub Desktop.
php ile yandex mail okuma - en basit hali
<?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