RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts</strong | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.69% (5.89%*) • Home Loan Fixed: 5.39% (6.59%*) • Fixed: 5.39% (6.59%*) • Variable: 5.69% (5.89%*) • Investment IO: 5.69% (6.48%*) • Investment PI: 5.39% (6.59%*)

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 complimentary 650-page guide on marketing for mortgage brokers. We'll show you exactly how we generate billions in volume for our clients.
Finance Guide, Cropped Top and Bottom
  Timezone: 1 · [ CHANGE ]

Like this article?

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

Leave a comment