PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- $hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
- $username = 'sdsd@gmail.com';
- $password = 'sdsds';
- $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
- if($emails){ // Check if there are any emails
- /* Get the email one by one using ID */
- foreach($emails as $email_number) {
- // Get the email [headers] like FROM, TO, SUBJECT, DATE, SERVER etc
- echo "<b>From:</b> ".$overview[0]->from."<br>";
- echo "<b>Date:</b> ".$overview[0]->date."<br>";
- echo $overview[0]->subject."<br>";
- // Get the Email Body
- echo $message; // Prints the message in Text format.
- }
- }
- /* close the connection */
- ?>