Download the PHP package laswitchtech/php-imap without Composer
On this page you can find all versions of the php package laswitchtech/php-imap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laswitchtech/php-imap
More information about laswitchtech/php-imap
Files in laswitchtech/php-imap
Package php-imap
Short Description phpIMAP is a full-featured mailbox management class for PHP
License GPL-3.0-only
Informations about the package php-imap
phpIMAP - [DEPRECATED] - Use coreIMAP instead
Description
phpIMAP is a PHP library that provides an easy-to-use interface for interacting with IMAP email servers. It includes two main classes: the Message class and the Attachment class.
The Message class allows you to retrieve and manipulate email messages from an IMAP server. It provides methods for retrieving the message headers, body, and attachments, as well as for marking messages as read or deleted. Additionally, it includes a constructor method that takes an email message as its input and parses it into a Message object.
The Attachment class is used to handle email attachments. It includes methods for identifying the attachment's filename, type, and encoding, as well as for retrieving and saving the attachment's content. This class is typically used in conjunction with the Message class's getAttachments method, which retrieves all attachments associated with a given email message.
Features
- Retrieve email messages from IMAP servers
- Get details of email messages such as sender, recipient, subject, date, and more
- Get the body of email messages in plain text or HTML format
- Get attachments from email messages and save them to disk
- Delete email messages from the server
- Move email messages to different mailboxes on the server
- Search for email messages on the server based on various criteria such as sender, recipient, subject, and date
- Mark email messages as read or unread on the server
- Flag email messages for follow-up on the server
- Handle errors and exceptions gracefully with detailed error messages and logging
- Customizable logging with phpLogger integration.
Why you might need it
The library provides a simple and powerful way to work with IMAP email servers in PHP, allowing developers to easily retrieve, manipulate, and store email messages and attachments.
Can I use this?
Sure!
License
This software is distributed under the GNU General Public License v3.0 license. Please read LICENSE for information on the software availability and distribution.
Requirements
PHP >= 5.5.0
Security
Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately.
Installation
Using Composer:
How do I use it?
Examples
Initialize
Methods
To make it easier, we will assume you have already initialized the class in .
phpIMAP
config()
This method allows you to change some internal configurations such as log level.
- 0: No Logging
- 1: Error Logging
- 2: Warning Logging
- 3: Success Logging
- 4: Info Logging
- 5: Debug Logging
connect()
This method creates a connection to an IMAP server.
close()
This method close an active connection of an IMAP server.
login()
This method allows to test a connection to an IMAP server.
isConnected()
This method return a boolean indicating if a connection is currently active or not.
getUsername()
This method returns the username of the active connection.
getHost()
This method returns the host of the active connection.
getFolders()
This method returns a list of folders available.
setFolder()
This method selects a folder.
createFolder()
This method creates a folder.
deleteFolder()
This method deletes a folder.
getMessages()
This method returns a list of messages in the selected folder.
Message
getTo()
This provides all TO addresses of a message.
getReplyTo()
This provides all REPLY-TO addresses of a message.
getFrom()
This provides all FROM addresses of a message.
getSender()
This provides all SENDER addresses of a message.
getCc()
This provides all CC addresses of a message.
getBcc()
This provides all BCC addresses of a message.
getUid()
This returns the UID of a message.
getId()
This returns the Message-Id of a message.
getSubject()
This returns the Subject of a message.
getDate()
This returns the Date of a message.
getBody()
This returns the Body of a message. HTML is returned if available, otherwise TEXT is returned.
read()
Set Seen
flag on message.
unread()
Clear Seen
flag on message.
flag()
Set Flagged
flag on message.
unflag()
Clear Flagged
flag on message.
draft()
Set Draft
flag on message.
undraft()
Clear Draft
flag on message.
answer()
Set Answered
flag on message.
unanswer()
Clear Answered
flag on message.
size()
Get the size of the message in bytes.
isRead()
Check if the flag Seen
is set on message.
isFlagged()
Check if the flag Flagged
is set on message.
isRecent()
Check if the flag Recent
is set on message.
isAnswered()
Check if the flag Answered
is set on message.
isDraft()
Check if the flag Draft
is set on message.
isDeleted()
Check if the flag Deleted
is set on message.
delete()
This will delete the message.
copy()
Copy this message to a different folder.
move()
Move this message to a different folder.
save()
This will save a message locally. Returns the file path.
getAttachments()
This method returns a list of attachments in the message.
Attachment
getDisposition()
This returns the Disposition of an attachment.
getEncoding()
This returns the Encoding of an attachment.
getId()
This returns the Content-Id of an attachment.
getFilename()
This returns the Filename of an attachment.
getFiletype()
This returns the Filetype of an attachment.
getContentType()
This returns the Content-Type of an attachment.
getContent()
This returns the Content of an attachment as a blob of data. It will also decode the data if an encoding is found.
save()
This will save an attachment locally. Returns the file path.
All versions of php-imap with dependencies
laswitchtech/php-net Version ^1.0
laswitchtech/php-configurator Version ^1.0