
- PHP Tutorial
- PHP - Home
- PHP - Introduction
- PHP - Environment Setup
- PHP - Syntax Overview
- PHP - Variable Types
- PHP - Constants
- PHP - Operator Types
- PHP - Decision Making
- PHP - Loop Types
- PHP - Arrays
- PHP - Strings
- PHP - Web Concepts
- PHP - GET & POST
- PHP - File Inclusion
- PHP - Files & I/O
- PHP - Functions
- PHP - Cookies
- PHP - Sessions
- PHP - Sending Emails
- PHP - File Uploading
- PHP - Coding Standard
- Advanced PHP
- PHP - Predefined Variables
- PHP - Regular Expression
- PHP - Error Handling
- PHP - Bugs Debugging
- PHP - Date & Time
- PHP & MySQL
- PHP & AJAX
- PHP & XML
- PHP - Object Oriented
- PHP - For C Developers
- PHP - For PERL Developers
- PHP Form Examples
- PHP - Form Introduction
- PHP - Validation Example
- PHP - Complete Form
- PHP login Examples
- PHP - Login Example
- PHP - Facebook Login
- PHP - Paypal Integration
- PHP - MySQL Login
- PHP AJAX Examples
- PHP - AJAX Search
- PHP - AJAX XML Parser
- PHP - AJAX Auto Complete Search
- PHP - AJAX RSS Feed Example
- PHP XML Example
- PHP - XML Introduction
- PHP - Simple XML
- PHP - Simple XML GET
- PHP - SAX Parser Example
- PHP - DOM Parser Example
- PHP Frame Works
- PHP - Frame Works
- PHP - Core PHP vs Frame Works
- PHP Design Patterns
- PHP - Design Patterns
- PHP Function Reference
- PHP - Built-In Functions
- PHP Useful Resources
- PHP - Questions & Answers
- PHP - Useful Resources
- PHP - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 |