This cool PHP function will create an RSS feed from the email in your Gmail inbox. It's a good way of including your mail with all the other content you aggregate in your RSS reader. I haven't tried it in a while so no longer sure if it still works.
1
<?php
2
/*
3
Gmail RSS Feed with PHP
4
http://www.beliefmedia.com/code/php-snippets/gmail-rss-feed
5
*/
6
7
function beliefmedia_gmail_rss_feed($username, $password) {
8
$url = "https://mail.google.com/mail/feed/atom";
9
10
11
curl_setopt($curl, CURLOPT_URL, $url);
12
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
13
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
14
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
15
curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password);
16
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
17
curl_setopt($curl, CURLOPT_ENCODING, "");
18
19
curl_close($curl);
20
21
return $gmail_data;
22
}
23
24
25
echo beliefmedia_gmail_rss_feed('YourUsername@gmail.com', 'Password');
Take appropriate measures to ensure security.