
- PHP - Home
- PHP - Roadmap
- PHP - Introduction
- PHP - Installation
- PHP - History
- PHP - Features
- PHP - Syntax
- PHP - Hello World
- PHP - Comments
- PHP - Variables
- PHP - Echo/Print
- PHP - var_dump
- PHP - $ and $$ Variables
- PHP - Constants
- PHP - Magic Constants
- PHP - Data Types
- PHP - Type Casting
- PHP - Type Juggling
- PHP - Strings
- PHP - Boolean
- PHP - Integers
- PHP - Files & I/O
- PHP - Maths Functions
- PHP - Heredoc & Nowdoc
- PHP - Compound Types
- PHP - File Include
- PHP - Date & Time
- PHP - Scalar Type Declarations
- PHP - Return Type Declarations
- PHP - Operators
- PHP - Arithmetic Operators
- PHP - Comparison Operators
- PHP - Logical Operators
- PHP - Assignment Operators
- PHP - String Operators
- PHP - Array Operators
- PHP - Conditional Operators
- PHP - Spread Operator
- PHP - Null Coalescing Operator
- PHP - Spaceship Operator
- PHP Control Statements
- PHP - Decision Making
- PHP - If…Else Statement
- PHP - Switch Statement
- PHP - Loop Types
- PHP - For Loop
- PHP - Foreach Loop
- PHP - While Loop
- PHP - Do…While Loop
- PHP - Break Statement
- PHP - Continue Statement
- PHP Arrays
- PHP - Arrays
- PHP - Indexed Array
- PHP - Associative Array
- PHP - Multidimensional Array
- PHP - Array Functions
- PHP - Constant Arrays
- PHP Functions
- PHP - Functions
- PHP - Function Parameters
- PHP - Call by value
- PHP - Call by Reference
- PHP - Default Arguments
- PHP - Named Arguments
- PHP - Variable Arguments
- PHP - Returning Values
- PHP - Passing Functions
- PHP - Recursive Functions
- PHP - Type Hints
- PHP - Variable Scope
- PHP - Strict Typing
- PHP - Anonymous Functions
- PHP - Arrow Functions
- PHP - Variable Functions
- PHP - Local Variables
- PHP - Global Variables
- PHP Superglobals
- PHP - Superglobals
- PHP - $GLOBALS
- PHP - $_SERVER
- PHP - $_REQUEST
- PHP - $_POST
- PHP - $_GET
- PHP - $_FILES
- PHP - $_ENV
- PHP - $_COOKIE
- PHP - $_SESSION
- PHP File Handling
- PHP - File Handling
- PHP - Open File
- PHP - Read File
- PHP - Write File
- PHP - File Existence
- PHP - Download File
- PHP - Copy File
- PHP - Append File
- PHP - Delete File
- PHP - Handle CSV File
- PHP - File Permissions
- PHP - Create Directory
- PHP - Listing Files
- Object Oriented PHP
- PHP - Object Oriented Programming
- PHP - Classes and Objects
- PHP - Constructor and Destructor
- PHP - Access Modifiers
- PHP - Inheritance
- PHP - Class Constants
- PHP - Abstract Classes
- PHP - Interfaces
- PHP - Traits
- PHP - Static Methods
- PHP - Static Properties
- PHP - Namespaces
- PHP - Object Iteration
- PHP - Encapsulation
- PHP - Final Keyword
- PHP - Overloading
- PHP - Cloning Objects
- PHP - Anonymous Classes
- PHP Web Development
- PHP - Web Concepts
- PHP - Form Handling
- PHP - Form Validation
- PHP - Form Email/URL
- PHP - Complete Form
- PHP - File Inclusion
- PHP - GET & POST
- PHP - File Uploading
- PHP - Cookies
- PHP - Sessions
- PHP - Session Options
- PHP - Sending Emails
- PHP - Sanitize Input
- PHP - Post-Redirect-Get (PRG)
- PHP - Flash Messages
- PHP AJAX
- PHP - AJAX Introduction
- PHP - AJAX Search
- PHP - AJAX XML Parser
- PHP - AJAX Auto Complete Search
- PHP - AJAX RSS Feed Example
- PHP XML
- PHP - XML Introduction
- PHP - Simple XML Parser
- PHP - SAX Parser Example
- PHP - DOM Parser Example
- PHP Login Example
- PHP - Login Example
- PHP - Facebook Login
- PHP - Paypal Integration
- PHP - MySQL Login
- PHP Advanced
- PHP - MySQL
- PHP.INI File Configuration
- PHP - Array Destructuring
- PHP - Coding Standard
- PHP - Regular Expression
- PHP - Error Handling
- PHP - Try…Catch
- PHP - Bugs Debugging
- PHP - For C Developers
- PHP - For PERL Developers
- PHP - Frameworks
- PHP - Core PHP vs Frame Works
- PHP - Design Patterns
- PHP - Filters
- PHP - JSON
- PHP - Exceptions
- PHP - Special Types
- PHP - Hashing
- PHP - Encryption
- PHP - is_null() Function
- PHP - System Calls
- PHP - HTTP Authentication
- PHP - Swapping Variables
- PHP - Closure::call()
- PHP - Filtered unserialize()
- PHP - IntlChar
- PHP - CSPRNG
- PHP - Expectations
- PHP - Use Statement
- PHP - Integer Division
- PHP - Deprecated Features
- PHP - Removed Extensions & SAPIs
- PHP - PEAR
- PHP - CSRF
- PHP - FastCGI Process
- PHP - PDO Extension
- PHP - Built-In Functions
PHP - IMAP Functions
IMAP stands for Internet Mail Access Protocol, PHP-IMAP functions helps you to access an email account and fetch emails from them. Using these functions you can also work with NNTP, POP3 protocols and local mailbox access methods. With the help of this library you can create web applications that handle your emails. Using this you can −
Connect to mailbox (POP3/IMAP/NNTP).
Retrieve e-mails with attachments.
Mark an email seen or unseen.
Remove emails etc...
Installation
To install IMAP in your system open php.ini file in your PHP installation folder and remove the semi colon (;) before the extension=imap (and other dependent extensions). Make sure you have installed a HTTP server software (like Apache 24), configure the installed server accordingly i.e. specify the location of the PHP installation folder, load the php7apache2_4.dll file module and, add the desired file types (extensions).
List of Functions
Following are various IMAP function that are available −
Sr.No | Function & Description | PHP |
---|---|---|
1 |
This function converts an 8bit string to a quoted-printable string. |
4 |
2 |
This function returns all the alert messages from starting of the page or, the last call of this function, in the form of an array. |
4 |
3 |
This function appends the given message to the specified mailbox. |
4 |
4 |
This function accepts a BASE64 encodex text as a parameter and decodes it. |
4 |
5 |
This function converts an 8bit string to a base64 string. |
4 |
6 |
This function accepts an IMAP stream representing a mail box and a message number, fetches the specified message from the given mail box. |
4 |
7 |
This function is used to read the structure of a specified body section. |
4 |
8 |
This function returns information about the given mail box. |
4 |
9 |
This function is used to remove flags on the specified messages in the given mailbox. |
4 |
10 |
This function is used to close the current mailbox. |
4 |
11 |
This function is used to create a new mailbox. |
4 |
12 |
This function is used to create a new mailbox. |
4 |
13 |
This function is used to mark messages/mails for deletion. |
4 |
14 |
This function is used to delete an existing mailbox. |
4 |
15 |
This function retrieves and returns all the errors occurred in the current page. |
4 |
16 |
This function deletes all the messages that are marked for deletion. |
4 |
17 |
This function retrives and returns the overview of the header info, of the specified method. |
4 |
18 |
This function is used to retrieve the specified section of the body of a mail/message. |
4 |
19 |
This function retrieves and returns the header of the specified mail/message in the current mailbox. |
4 |
20 |
This function retrieves and returns the MIME headers of the specified section of a message. |
4 |
21 |
This function retrieves and returns the structure of the specified message in the current mailbox. |
4 |
22 |
This function fetches the specified message from the given mail box. |
4 |
23 |
This function is used to clear the cache of the given mailbox. |
5 |
24 |
This function is used to retrieve the quota level settings, and usage statics of the specified mailbox. |
4 |
25 |
This function is used to retrieve the quota level settings per user. |
4 |
26 |
This function is used to retrieve the information on the mailboxes. |
4 |
27 |
This function is used to retrieve information about all the subscribed mailboxes. |
4 |
28 |
This function is used to read the header of the specified message. |
4 |
29 |
This function is used to read the header of the specified message. |
4 |
30 |
This function is used to retrieve the headers for all the messages in the specified mailbox. |
4 |
31 |
This function retrives and returns the last occurred error message. |
4 |
32 |
This function reads and returns the list of specified mailboxes. |
4 |
33 |
This function is an alias of imap_list(), it reads and returns the list of specified mailboxes. |
4 |
34 |
This function is used to retrieve names of the mailboxes containing the given text. |
4 |
35 |
This function is an alias of imap_lsub(). It retrieves the headers for all the messages in the specified mailbox. |
4 |
36 |
This function is used to retrieve the headers for all the messages in the specified mailbox. |
4 |
37 |
This function creates a MIME message based on the details. |
4 |
38 |
This function copies the specified messages to the given mailbox. |
4 |
39 |
This function moves the specified messages to the given mailbox. |
4 |
40 |
This function is used to send the given message. |
4 |
41 |
This function retrieves and returns the information about the current mailbox. |
4 |
42 |
This function is used top decode the given MIME header. |
4 |
43 |
This function retrieves and returns the sequence number of the given UID. |
4 |
44 |
This function is used to retrieve decodes the given string into UTF-8 format. |
4 |
45 |
This function is used to retrieve the number of the messages in the specified mailbox. |
4 |
46 |
This function is used to retrieve the number of recent messages in the specified mailbox. |
4 |
47 |
This function opens stream to the specified mailbox. |
4 |
48 |
This function is used to verify whether the given stream is still active. |
4 |
49 |
This function returns an 8-bitstring for the quoted-printable string. |
4 |
50 |
This function is an alias of imap_renamemailbox(). It is used to rename an existing mailbox. |
4 |
51 |
This function is used to rename an existing mailbox. |
4 |
52 |
This function is used reopen the given stream to a new mailbox. |
4 |
53 |
This function is used to parse an address string. |
4 |
54 |
This function is used to parse and returns headers from the given string. |
4 |
55 |
This function returns the formatted email address for the given details. |
4 |
56 |
This function saves the body of the given mail in the specified file path. |
4 |
57 |
This function searches the mailboxes for the given text and returns the mathched messages. |
4 |
58 |
This function searches the mailboxes for the given text and returns the matched messages. |
4 |
59 |
This function searches the mailbox and returns the matched messages in the form of an array. |
4 |
60 |
This function sets the specified quota for the given mailbox. |
4 |
61 |
This function sets the specified flags on the given messages. |
4 |
62 |
This function retrieves the messages in the given mailbox in the specified sorted order. |
4 |
63 |
This function retrieves and returns the status of the given mailbox. |
4 |
64 |
This function is used to subscribe to a new mailbox. |
4 |
65 |
This function is used to set/fetch the time out value. |
4 |
66 |
This function is used to retrieve the UID for the given message. |
4 |
67 |
This function is used to unmark all the messages that are marked for deletion in the specified mailbox. |
4 |
68 |
This function is used to unsubscribe from the given mailbox. |
4 |
69 |
This function is used to decode an UTF-7 string to ISO-8859-1 format. |
4 |
70 |
This function is used to encode an ISO-8859-1 string to an UTF-7 string. |
4 |
71 |
This function is used to encode the UTF-8 string to UTF-7 string. |
4 |
72 |
This function is used to decode the MIME encoding string into simple UTF-8 string. |
4 |