Home  >  Article  >  Backend Development  >  What does Imap mean? Detailed explanation of php imap function_PHP tutorial

What does Imap mean? Detailed explanation of php imap function_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 14:57:491761browse

The full name of imap is internet message access protocol, which is a multi-mailbox email system developed by Stanford University in the United States in 1986. The functionality provided by php is the imap 4 system, which is implemented according to rfc 1730. For more information about imap, please refer to imap’s official website http://www.imap.org.

To use the email function of imap, you must first download the imap client program from ftp://ftp.cac.washington.edu/imap. After compilation is completed, copy c-client/c-client.a to /usr/local/lib, and copy the three files c-client/rfc822.h, mail.h and linkage.h to /usr/ under local/include. Later, when compiling the php program, you need to add the –with-imap option.

imap_append: append a string to the specified mailbox.
imap_base64: Decode base64 encoding.
imap_body: Read the text of the letter.
imap_check: Return email information.
imap_close: Close imap link.
imap_createmailbox: Create a new mailbox.
imap_delete: Mark emails for deletion.
imap_deletemailbox: Delete existing mailbox.
imap_expunge : Delete flagged messages.
imap_fetchbody: Fetch the specified part from the message body.
imap_fetchstructure: Get the structure information of a letter.
imap_header: Get the header information of a letter.
imap_headers: Get the header information of all letters.
imap_listmailbox: Get the mailbox list.
imap_listsubscribed: Get the subscription email list.
imap_mail_copy: Copy the specified mail to another mailbox.
imap_mail_move: Move the specified mail to another mailbox.
imap_num_msg: Get the number of letters.
imap_num_recent: Get the number of new messages.
imap_open : Open imap link.
imap_ping: Check if imap is connected.
imap_renamemailbox: Change the name of the mailbox.
imap_reopen: Reopen imap link.
imap_subscribe: Subscription email.
imap_undelete: Undelete mail mark.
imap_unsubscribe: Unsubscribe email.
imap_qprint: Convert qp encoding to eight bits.
imap_8bit: Convert eight bits to qp encoding.
imap_binary: Convert eight bits to base64 encoding.
imap_scanmailbox: Find whether the mail contains a specific string.
imap_mailboxmsginfo: Get the current mailbox information.
imap_rfc822_write_address : Email address standardization.
imap_rfc822_parse_adrlist : Parse email addresses.
imap_setflag_full: configure letter flag.
imap_clearflag_full : Clear letter flag.
imap_sort : Sort message headers.
imap_fetchheader: Get the original header.
imap_uid: Get the letter uid.
imap_getmailboxes: Get all mail details.
imap_getsubscribed: List all subscription emails.
imap_msgno : Continuous letters listing uids.
imap_search: Search for letters with specified criteria.
imap_last_error: The last error message.
imap_errors: all error messages.
imap_alerts: All warning messages.
imap_status: Current status information.

imap_append
Appends a string to the specified mailbox.
Syntax: int imap_append(int imap_stream, string mbox, string message, string [flags]);
Return value: integer
Function type: Network system
Content description: This function can be used in the specified Adds an additional string to the email address. The parameter imap_stream is the code name of imap. The parameter mbox is the email address. The parameter message is the information to be appended. The parameter flag is an omitted flag, indicating the flag value of the email address. Note: When communicating with the cyrus imap server, you should use rn as the end-of-line character (eol). If there is an error, a false value is returned.

imap_base64
Decode base64 encoding.
Syntax: string imap_base64(string text);
Return value: String
Function type: Network system
Content description: This function can decode base64 encoded string. The return value is the decoded string.
Reference imap_binary() base64_encode() base64_decode()

imap_body
Read the text of the letter.
Syntax: string imap_body(int imap_stream, int msg_number, int [flags]);
Return value: String
Function type: Network system
Content description
This function can read letters The body part of . The parameter imap_stream is the code name of imap. The parameter msg_number is the serial number of the letter. The parameter flags can be omitted and has the following values ​​
ft_uid: the letter serial number is uid.
ft_peek: Do not set this flag if the seen flag is not configured.
ft_internal: The returned string uses the system format, do not deliberately convert it to the crlf line ending standard.
Usage Example
This example uses the imap protocol to read the first email of myid@localhost.

imap_check
Returns email information.
Syntax: object imap_check(int imap_stream);
Return value: Class
Function type: Network system
Content description: This function can obtain the current email address information. The return value is a class type, including the following attributes
date date of the latest email interface used by the driver mailbox email address nmsgs total number of emails recent number of new emails
description of the meaning of the class attributes
refer to imap_mailboxmsginfo()

imap_close
Close the imap link.
Syntax: int imap_close(int imap_stream, int [flags]);
Return value: integer
Function type: Network system
Content description: This function is used to close the data stream of imap, that is, End link. If the value of the omitted parameter flags is cl_expunge, the email mailbox will be emptied before closing the link.
imap_createmailbox
Create a new mailbox.
Syntax: int imap_createmailbox(int ​​imap_stream, string mbox);
Return value: integer
Function type: Network system
Content description
This function is used to create a new mailbox. Returns true value on success.

imap_delete
Marks emails for deletion.
Syntax: int imap_delete(int imap_stream, int msg_number);
Return value: integer
Function type: Network system
Content description
This function is only used to mark emails to be deleted. The instruction actually deleted imap_expunge()

imap_deletemailbox
Delete the existing mailbox.
Syntax: int imap_deletemailbox(int ​​imap_stream, string mbox);
Return value: integer
Function type: Network system
Content description: This function is used to delete an existing mailbox. Returns true value on success.

imap_expunge
Delete flagged messages.
Syntax: int imap_expunge(int imap_stream);

  • Total 5 pages:
  • Previous page
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next page

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/363940.htmlTechArticleThe full name of imap is internet message access protocol, which is the Internet message access protocol. It is the name of Stanford University in the United States. University) began developing multiple mailbox emails in 1986...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn