RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.78% (6.81%*) • Investment PI: 5.49% (6.32%*)

Gmail RSS Feed with PHP

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
  $curl = curl_init();
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
  $gmail_data = curl_exec($curl);
19
  curl_close($curl);
20
 
21
 return $gmail_data;
22
}
23
 
24
header('Content-Type:text/xml; charset=UTF-8');
25
echo beliefmedia_gmail_rss_feed('YourUsername@gmail.com', 'Password');

Take appropriate measures to ensure security.

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment