Read Gmail Email
Read Gmail Email
### Steps:
- Enable IMAP.
2. **Allow less secure apps (Optional but not recommended)**: If you don’t
have OAuth set up, you can allow less secure apps on Gmail, but Google
advises against it for security reasons.
3. **PHP IMAP Script**: Below is a basic example for reading emails using the
IMAP extension:
```php
<?php
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
if ($emails) {
rsort($emails);
} else {
imap_close($inbox);
?>
```
### Explanation:
```ini
extension=imap
```