php-imap | Manage mailboxes , filter/get/delete emails | Email library
kandi X-RAY | php-imap Summary
kandi X-RAY | php-imap Summary
Initially released in December 2012, the PHP IMAP Mailbox is a powerful and open source library to connect to a mailbox by POP3, IMAP and NNTP using the PHP IMAP extension. This library allows you to fetch emails from your email server. Extend the functionality or create powerful web applications to handle your incoming emails.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get a single message header .
- Initialize a single mail part
- Sorts a mailbox by criteria .
- Performs a search on an IMAP stream .
- Embed image attachments .
- Replace internal links placeholders .
- Decodes data after fetching .
- Save data to disk .
- Convert the encoding after fetching
- Get file info
php-imap Key Features
php-imap Examples and Code Snippets
Community Discussions
Trending Discussions on php-imap
QUESTION
I'm sending email to users with Laravel. It's working fine.
So I'm now reading my inbox with PHP-IMAP to catch users email responses.
How can I identify an incoming email to the previous sent message?
I tried using mail header: $headers->addTextHeader('X-request_id', $request->id);
The header is correctly sent to user but in response message the header is not present anymore.
Any suggestion?
...ANSWER
Answered 2021-Jan-08 at 14:05I am pretty sure that there is no way to preserve headers so that the same header is returndes in a reply.
the simple solution: A lot of bug tracking software systems use an id in the subject or the text of the email e.g. the case number and parse the case number from the subject. this will survive all kinds of mail systems spam and virus checkers and more.
A different approach would be to create specific email adresses including the id inside the email adddress for each email. But this is far more complicated.
A similar way is used if you have internal messages from user to user that are sent and can be replied by email. so user34@users.example.com sends an email to user 3432@users.example.com If you want to prevent email disclosure. Then you would need either a service like cloudmailin or your own mailserver with the necessary logic.
QUESTION
I am running into some problems trying to update composer, after trying to add php-imap.
I am getting this error:
...Plugin initialization failed (include(/var/www/vendor/composer/package-versions-deprecated/src/PackageVersions/Installer.php): failed to open stream: No such file or directory), uninstalling plugin
- Removing composer/package-versions-deprecated (1.10.99) Install of composer/package-versions-deprecated failed
[RuntimeException]
Could not delete /var/www/vendor/composer/package-versions-deprecated/src:the file (/var/www/vendor/composer/package-versions-deprecated/src/PackageVersions/Installer.php) does exist.
ANSWER
Answered 2020-Jul-21 at 12:11Composer cannot delete the /var/www/vendor/composer/package-versions-deprecated/src
directory. I guess current user cannot write/delete directory in /var/www
Option1 (recommanded) You can (you have to) fix the right to this directory and verify that current connected user has enough privilege to do it.
Option2 You can install application locally (in a directory where current user have all privileges, Launch composer Move via root the application to the /var/www directory Chown files to the good user. (www:data ?)
Option3 (not recommanded) You can delete this directory manually via root. But I'm sure you will encountered a lot of other problems.
QUESTION
I'm trying to modify my dockerfile so that it will install php-imap for php on our docker container
I have this:
...ANSWER
Answered 2020-Mar-09 at 20:20Try:
QUESTION
I'm trying to run php-fpm in gitpod.io.
But when I run following command...
ANSWER
Answered 2019-Sep-24 at 14:42I'm not familiar with php-fpm therefore I'm not able to test if my solution runs correctly. However, I'm able to start php-fpm in Gitpod when I change the paths in the php-fpm config files to locations the user gitpod is allowed to write to.
You'll find the configuration of php-fpm in /etc/php/7.2/fpm/
(you may have to change the version number if you use 7.1). I created a simple config file where the pid file, the socket file and the log file will be written to /tmp/
, a location the user gitpod is allowed to write files to:
QUESTION
Does anyone know how to install and enable PHP IMAP Extension on AWS Elastic Beanstalk using configuration files (.ebextensions)?
I'm using 64bit Amazon Linux 2017.03 v2.4.0 running PHP 7.0.16
I've tried several ways as follow:
1st Way
I've tried using files
in configuration file but it doesn't work, the configuration filename is phpini.config
in .ebextensions
directory with below setup:
ANSWER
Answered 2017-Jul-05 at 03:32You’re including the php-imap extension in php’s configuration file, but that’s not sufficient to install it.
You’re going to have to pass something to your EBS provisioning method of choice telling it to install php-imap (or whatever it’s called in that environment) at the system level.
QUESTION
I'm working on a project with Zend Framework 2.4.13, and I have to retrieve mails from an imap
mailbox. For this purpose I use \Zend\Mail\Storage\Imap
:
ANSWER
Answered 2019-Aug-02 at 15:20Although RFC 6532 isn't strictly relevant to the problem, implementing reading support for it in ZF2 is probably the simplest way to solve your problem.
This is because 6532 extends the message format to support addresses such as stéph@example.com, and it does so in a way that resembles common behaviour up through the years. People do a lot of inappropriate just-send-8, and the authors of 6532 chose to match the most common type of observed user behaviour. The message you want to read uses just the kind of inappropriate just-send-8 that 6532 codifies and allows.
Adding support for reading 6532-compliant messages should be as simple as editing various syntax checks and letting through more code points. I have some test messages on github; if ZF2 can parse those you'll be able to read and act on the EAI messages real users send.
Acting on messages sent by mailer-daemon requires 6533 support as well, and replying may require more 6532-relevant work. That bit is complex. But reading mail is a useful ability in itself.
QUESTION
This is a similar question to this one here: PHP imap_search: UTF-8 / Non-ASCII characters on Microsoft Exchange mail servers
But with the difference, that the mail server in this case supports UTF-8 searches and we also use UTF-8 in the imap_search
function.
I have an email subject like this: mountainguan测试
I want to search the email with this subject or a part of the subject using this PHP code:
...ANSWER
Answered 2019-Jun-19 at 19:41You don't have to encode $criteria
string at $mailsIds = imap_search($mbox_connection, 'SUBJECT "mountain"', SE_UID, "UTF-8");
Please check encoding of your php script (imap-test.php). Probably it isn't UTF-8.
Could you convert encoding into UTF-8 and then change $criteria
into mountainguan测试
?
QUESTION
I am trying to create an image in docker with apache2, php7.2 with pdo_informix, but I have not been successful, I just do not see the extension enabled and I do not know if I'm doing a wrong step.
I share what I have so far in the following repository: here
Dockerfile:
...ANSWER
Answered 2018-Aug-21 at 01:26In Dockerfile
, use docker-php-ext-install
command to install php
extension or module. If you use reguler apt-get install
command, you should add step to enable it. See the example bellow, how to use the command:
QUESTION
I am using php 5.6.12 version, I have to compulsory use this version.
running command : composer update
it is showing me like below,
...ANSWER
Answered 2018-Nov-01 at 11:51Ok let me summarize.
Create a composer.json file in C:/Users/hetal.gohel/AppData/Roaming/Composer/composer.json
. Just fill it with an empty json object {}
. And then run composer update -vvv
to see the update process in detail. Just wait until it's done. If the update process takes too long may be you should add the package dependency one by one.
QUESTION
I need to install php-imap on amazon ec2 linux 2 instance. All the php stuff is inside amzn2extra-lamp-mariadb10.2-php7.2 but php-imap package is missing. Any advice ?
Thanks
...ANSWER
Answered 2018-Jun-06 at 11:53Same problem here.
I came from debian/ubuntu and i miss a lot of php packages on aws linux2. I know it's still a candidate and not a final LTS release. Only worked for a month with this distro and saw a lot of changes and updates. Some php dependencies can be solved with pear or pecl, but I couldn't get nothing working on php-imap.
php-imap depends on libc-client (maybe that's a problem?)
Here is my solution.
- Search for the libc-client rpm that correspond to your version and install manually.
- Search for the rpm that corresponds to your php installed version. In my case it was 7.2.5**-2** about 2 weeks ago. (today is 7.2.5**-3** ) and isntall manually
CODE
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install php-imap
Below, you'll find an example code how you can use this library. For further information and other examples, you may take a look at the wiki. By default, this library uses random filenames for attachments as identical file names from other emails would overwrite other attachments. If you want to keep the original file name, you can set the attachment filename mode to true, but then you also need to ensure, that those files don't get overwritten by other emails for example.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page