PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Abhijit Jagtap   PHP IMAP Search   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: To find the unread emails when looping through look for the ->Unseen property like so:
Class: PHP IMAP Search
Find and save messages in IMAP server to database
Author: By
Last change: update
Date: 8 years ago
Size: 779 bytes
 

Contents

Class file image Download
<?php
ini_set
('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ERROR);
require_once
'src/imap.php';
/*
 * imap credentials goes here
 */
$authhost = "{xxxx.net:143/novalidate-cert}INBOX";
$email = "yyy@xxxx.net"; //dummy text. I swear i dont have typo here
$emailPassword = "zzzz"; //dummy text. No typo here.


$imap = new imap($authhost, $email, $emailPassword);
/*
 * if you want to save in db.
 */
$imap->save_into_db = FALSE; //default its TRUE
/*
 * if @save_into_db=TRUE then plz provide following details
 */
$imap->serverIP = "localhost";
$imap->userName = "****";
$imap->userPassword = "********";
$imap->databaseName = "db_name";

/*
 * get new mails
 */
$imap->search("UNSEEN");

/*
 * ooooh its done!
 */