Newsletter: Xanax and grapefruit Phentermine 30mg Buprenorphine Bulk phentermine Iothalamate Purchase cialis online Buy generic viagra 50 mg tramadol Oxcarbazepine Cialis drug prescription Viagra supplier Cefpodoxime 2mg xanax Yohimbe and viagra Prednisone Hydrocodone vicodin Phentermine effects on birth control Klonopin xanax Soma sleep Loprox Fastin Cheap phentermine no prescription Medroxyprogesterone Meridia better than phentermine Phentermine pill Buy online viagra securely Cialis generic Viagra without a perscription Deferoxamine Tolbutamide Phentermine and methamphetamine Phentermine quick Valium vicodin Cialis dysfunction erectile levitra viagra Alka seltzer Phentermine + sale Order fioricet online Mylan xanax Alphaprodine Non perscription generic cialis Lisinopril with viagra Dextrothyroxine Camphor Where can i buy viagra Protamine Dilantin Canadian cialis Micronase Free viagra order online Clomipramine Ticarcillin Tyropanoate Tinzaparin Ordering viagra Warfarin Imiquimod Phentermine hcl side effects Darvocet Cyclobenzaprine Oxyphenbutazone Probenecid Vytorin 5 mg diet pills Fentanyl Etretinate Custom hrt phentermine Best buy phentermine Buying viagra Alavert Drug test tramadol Lamotrigine Disulfiram Cyclothiazide Lowest price on phentermine Cheep paris france phentermine Dimenhydrinate Prescriptions on line phentermine Viagra without a prescription Cheap vicodin Miconazole Taking viagra or levitra as a booster for cialis Information phentermine shortage Cialis comparison levitra Valtrex University rochester viagra pfizer Buy xanax without prescription Nitric oxide viagra Celiprolol Cialis levivia viagra vs vs Avandia Non prescription viagra Levothyroxine Mepenzolate Phentermine weight loss pills Vancomycin Free viagra samples Phentermine pill online discount Clarinex Phentermine very cheap Cozaar Sulfonamides Methamphetamine Hexamethonium Meperidine Cialis Clozapine Adenosine Withdrawal from xanax Anafranil Feldene Drug loss phentermine weight Xanax look alike High cortisol level phentermine Spectinomycin Filing income tax phentermine Prozac drug interaction with xanax Buy cheap phentermine cod Ceforanide Injecting xanax Lodine leukemia symptoms Phentermine delivered cod Phentermine no credit card required Prednisone Thiotepa Treat crohns disease with viagra Buy cheap phentermine yellow Buy Xanax Phentermine picture Elavil Buy cheap no phentermine prescription On line viagra Phendimetrazine Cialis forums Xanax depression Buying viagra online Buy online phentermine shipping 90 $89 mastercard Viagra online order guide Lactulose Xanax online prescription Cheapest xanax online Xanax online no prescription Methixene Vicodin detox Cheap phentermine overnight delivery Purchase tramadol online Comparison viagra cialis levivia Laetrile Side effects of xanax mylan Buy cialis generic online 5mg cheap Cheap prices phentermine Xanax dosages Xanax ambien Alprazolam xanax Diethylstilbestrol No fax payday loan buy tramadol Oxycontin xanax bars perclesept and lortab Piperidolate Fluorouracil Can i take xanax with zocor and procardia Chlorhexidine Tretinoin Viagra class action Viagra sales online Lowest price for phentermine Epinephrine Thiabendazole Methadone xanax interaction Cod phentermine shipped Levallorphan Codeine Cephalexin Mexican pharmacy viagra Cialis viagra levivia Phentermine side effects dangers Elocon Klonopin vs xanax dosage Buy online order viagra Ampicilin Phenacetin Language phentermine ru Pill price viagra What is xanax Withdraw xanax Dangers of phentermine Soma san diego Anxiety disorder xanax Cheap 37 5 phentermine Phentermine use Lotrimin Primidone Cialis soft Dexchlorpheniramine Viagra faq Hydrocodone vicodin Estradiol Viagra online Viagra for woman Phentermine overnight shipping Buy online tramadol Drug interactions with cialis Akane soma Diet discount phentermine pill Mail order viagra online Compare generic viagra prices Phentermine mexican pharmacies online Cialis price comparison Meridia vs phentermine Cialis viagra Meridia Taking phentermine with antidepressants Cheap tramadol no prescription Women viagra Tramadol pharmacy Online pharmacy and phentermine Levitra vs cialis vs herbal Viagra online no prescription Avandamet Best generic viagra Phentermine yellow Is phentermine dangerous Viagra online pharmacy Meridia diet pill Free shipping phentermine Viagra uk sales Free ambien 2005 comment december leave viagra Phentermine 30 mg ordered with discover card Mobic Phentermine cheap Reliable same or next day phentermine purchase online Order vicodin online Paregoric Phentermine success story Compare phentermine price Phentermine and glaucoma Ephedrine Cialis for sale Viagra on line uk Methadone and xanax Phentolamine Viagra xenical Hetacillin Free pack sample viagra Rated online pharmacies for phentermine Cialis side effects Aspartame Adipex Actonel Viagra alternative and woman Phentermine lortab online Cruises soma Phentermine 37 5mg Hydrocodone overnight Lopressor Phentermine at cost with no prescription About phentermine Long term effects of xanax Phentermine buy best Buy discount cialis Buy online pharmacy viagra 5mg Prempro Cialis experience Cephradine Phentermine hydrochloride Online tramadol prescriptions Vicodin picture Crestor Cheapest phentermine 90 day orders Climara Metrizamide Hydrocodone apap Does viagra work for women Sufentanil Phentermine reviews Viagra alternatives Anafranil Diet pill addiction phentermine Gabapentin Discount online viagra Lethal dose of xanax Lethal doses of klonopin and xanax Phentermine 15mg Nonoxynol Buspar Xanax long term effects Phentermine drug interaction Phentermine free shipping Hydrocodone withdrawal Order xanax online Digoxin Online viagra Cheapest price phentermine online pharmacy Methantheline Macular degeneration caused by viagra Nolvadex Phentermine next day delivery Mephenytoin Aldara Paromomycin How fast can you loss weight with phentermine Amoxicillin Flurbiprofen Phentermine shortage Can xanax cause frontal lobe dementia Purchase soma Lopid Phentermine dosage Xanax doses Provera Viagra users Concerta Premarin Discount pharmacy phentermine Metrizoate Cefdinir Viagra prescription uk 10 min viagra Keppra Maprotiline Phentermine tricks Avandamet Accolate Viagra commercial Research phentermine tolerance Ambien cr Buy cheap online uk viagra Zyban Tramadol hydrochloride tablet Discount phentermine no prescription Side effects of viagra Luvox Try viagra for free Phentermine online pay with mastercard Snorting xanax Tetanus Sophia viagra Succinylcholine Aerobid Phentermine prescription online Probucol Xanax online without a prescription Biaxin Soma Hydrocodone info Phentermine from canada Does xanax show up on drug tests Dutasteride Flutamide Non prescription xanax 0 buy by popl powered viagra wordpress Discount meridia Diphenadione Diltiazem Buying viagra in the uk Free viagra Picture of soma Valium Online phentermine order Drug interaction xanax and holy basil Buy phentermine online cod Adipex phentermine weight loss Cialis impotence drug eli lilly co Xanax without prescription Arava Decadron Phentermine line Irbesartan Phendimetrazine Nizatidine Methaqualone Seroquel Coreg Cipro Canada viagra Cheapest phentermine online no prescription Bethanechol Xanax overnight Buy locally viagra Fenfluramine Lowest drug price for phentermine Rizatriptan Crohns phentermine Phenytoin interaction with xanax Phentermine prescriptions online Perscription phentermine Imiquimod Abbr href rel title title viagra Kaopectate Viagra female sexual inhancement Metronidazole Phentermine online diet pill Acyclovir Prescription order viagra online Hydrocodone cough Norethynodrel Methyclothiazide Snorting vicodin Blindness viagra Xanax overnight shipping Phentermine 15 mg Cheap soma Cialis commercial Klonopin versus xanax Norepinephrine Indapamide Physostigmine Nicoumalone Phentermine ephedrine Flagyl Liotrix Griseofulvin Us pharmacy phentermine Discount cialis online Clofazimine Biaxin What does phentermine look like Buy phentermine online same day delivery Recreational viagra use Phentermine shipped to missouri Buy viagra order viagra Phentermine capsules Tramadol hcl Dangers of taking xanax and neurontin Drug information on xanax History of phentermine use Zafirlukast Discount generic viagra Tramadol withdrawal Phentermine interactions Methazolamide Overnight phentermine Avalide Sertraline Discount drug phentermine Timolol Altace Phentermine and fast shipping Loxapine Cheap generic viagra online Tricor Valsartan Phentermine referring report urls Buy canada cialis Strattera Phentermine diet plan Where to buy phentermine online Order phentermine online Tramadol online pharmacy Levodopa Piperazine Zanaflex Ultracet Meloxicam Amsterdam holland viagra Addiction recovery xanax Overnight viagra Premphase 5 pay by money order Trimethoprim Order viagra without prescription Didanosine No prescription phentermine free shipping Oxyphencyclimine Cyclandelate Lowest phentermine 37 5 prices Losec Generic viagra uk Ceftizoxime Cialis soft tabs Dantrolene Chlorprothixene Neurontin Non prescription phentermine Aprotinin Cheap viagra uk Clarinex Phentermine no fees No prescription cialis Xanax without a prescription Eldepryl Viagra overnight Phentermine 37_5 Imdur Cheap viagra india Phentermine $89 Buy Phentermine Hydrocodone mexican pharmacy what is tramadol Generic viagra lowest prices Clindamycin Phentermine diet medication Hydrocodone guaifenesin Adapalene Buy phentermine online with pay pal Viagra substitutes Phentermine result Phentermine ship to ky Phentermine weight loss pill Mirtazapine Uk viagra supplier Prozac interact xanax Herbal phentermine Xanax death Phentermine and blood in stool Bromides Tramadol 200 mg Cefadroxil Lorazepam Zolpidem Ambien side effects Mercaptopurine Phentermine with master card Xanax drug interactions 2 mg xanax Buy domain onlinebigsitecitycom phentermine Chlortetracycline Cheap online phentermine prescription Flexeril Vinblastine Side effects of xanax xr Nitrofurantoin Colestipol Order phentermine c o d Phentermine uses Tapering off xanax Gentamicin Cheap viagra in uk Buy online purchase viagra Buy xanax online Ceclor Paroxetine Online pharmacy phentermine cod Captopril Toradol Buy viagra pill Crystal meth and xanax Amlodipine Buy cheapest viagra Nizoral Gitalin Apomorphine Buy Bontril Phentermine cod delivery Online phentermine pharmacy best cheapest Any drug interaction xanax and cold meds Natural viagra Fosfomycin Online xanax prescription Generic name online qoclick tramadol Phentermine blue 30 mg Flurazepam Mometasone Buy cialis in uk Long term side effects of phentermine Granisetron Norflex Cheap phentermine online withour prescription Filling online prescription viagra Secobarbital Viagra overdose Buy Ultram Phentermine able to beshipped to mo Xenical Xanax urine test Buy online securely viagra Canadian no phentermine prescription Viagra cialis Epoprostenol Buy viagra cheap Buy tramadol online without a prescription Soma online pharmacy Alcohol hydrocodone Cheap soma online Fioricet information Restoril Clindamycin Phentermine and glucophage Online cialis d method Buying phentermine Online ordering viagra Aura soma Cialis western open Xanax and drug testing Pioglitazone Viagra generic brand Mycostatin Tramadol saturday delivery Viagra dose Xanax libido Low price phentermine Cheap diet phentermine pill Viagra information India generic viagra How do i stop taking phentermine Free phentermine prescriptions Chlorpheniramine Viagra cream for woman Alfentanil American express phentermine Purchase hydrocodone Meridia versus phentermine Phentermine $70 no prescription Cefazolin Buy viagra now Buy viagra in canada Buy viagra 1 Viagra for women Shipping phentermine to florida Phentermine depression Viagra results Digitoxin Cheapest tramadol online Ketoprofen Buy viagra in uk Vicodin online pharmacy Purchase tramadol Phentermine side effects Cipro Picture of generic xanax Cause rebound weight gain phentermine Mexiletine Mebendazole Canada cialis Cheapest online viagra

Entries Comments



PHP Helps you read your email

30 August, 2007 (09:44) | PHP Tricks | By: passion@php

Introduction

E-mail is something we use every day, and almost everyone has their own e-mail address. To read our e-mail most of us tend to use something like Microsoft Outlook or Mozilla Thunderbird, but it’s also possible to use PHP to read your e-mail. In this tutorial you will learn how.I will take you through all the steps necessary to read your e-mail with PHP, and show you how to display all the newest e-mails in your inbox.Let’s get started!

The Basics

To retrieve the e-mails in our inbox we will have to use the POP3 protocol, and the raw PHP socket functions, such as fsockopen. But why should we all write it from scratch, when there are already many great libraries available?That’s why we’re going to use a POP3 class from PHPClasses.org, available at http://www.phpclasses.org/browse/package/1120.html. Unfortunately, you’ll need to login to download the package, but registration doesn’t take long.

Once you’ve downloaded the class, try the following example:

<?php
require ('pop3.class.inc'); $pop3 = new POP3;// Connect to mail server
$do = $pop3->connect ('YOUR-EMAIL-SERVER-HERE);
if ($do == false) {
die($pop3->error);
}
echo 'Connected to mail server';
$pop3->close();
?>

In the above example you will have to put in your own mail server. If you don’t know what your own mail server is, try something like mail.YOURDOMAIN.com or mail.YOURISP.com.If everything goes okay, you will see ‘Connected to mail server’ when running the example. This means that the script was able to connect to your mail server, and the next step is to login to your e-mail inbox.This can be done with the login() method, and you will have to pass your username (which is usually your e-mail address) and your password, like this:

// Login to your inbox
$do = $pop3->login ('email@address.goes.here.com, 'password-here'); if ($do == false) {
die($pop3->error);
}
echo 'Logged in';

Now that we’ve logged into our inbox, we’re almost ready to start downloading new e-mail messages, but first we have to get the ‘office status’, which basically tells our script how many new e-mails there are.The office status can be retrieved with the get_office_status() method;

see the example below:

// Get office status
$status = $pop3->get_office_status(); if ($status == false) {
die($pop3->error);
}
$count = $status['count_mails'];
echo 'There are ' . $count . ' new e-mails waiting for you!';

As you can see in the above example, the get_office_status() method returns an array, which includes the number of new e-mails, but also a few other details, such as the total size of the new e-mails. This will allow you to create a neat looking progress bar.Now we can start retrieving the new e-mails with a for-loop and the get_mail() method, like this:

for ($i = 1; $i <= $count; $i++) {
$email = $pop3->get_mail($i); if ($email == false) {
echo $pop3->error;
continue;
}
echo ‘<pre>’;
print_r ($email);
echo ‘</pre>’;
}

If you run the above example, it will print every new e-mail in your inbox, including the headers of each e-mail.
Source: Totally PHP

Comments

Comment from Day care jobs Directory
Time: April 22, 2008, 1:33 pm

We have a functionality in Outlook “send receive” so it will automatically pick the email from server to our inbox, can we customize this functionality in PHP? If this can be done, it would be really great.

Write a comment

You must be logged in to post a comment.