PHP Classes


Recommend this page to a friend!
  Classes of Uldis Nelsons   D3 PHP POP3 Receive Email   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: D3 PHP POP3 Receive Email
Retrieve email messages from POP3 mailbox with YII
Author: By
Last change:
Date: 3 years ago
Size: 1,509 bytes


Class file image Download



  • read emails from diferent pop3 and attach to model records


php composer.phar require d3yii2/d3pop3 dev-master

* add to config/console.php

    'modules' => [
        'D3Pop3' => [
            'class' => 'd3yii2\d3pop3\d3pop3',
            'ConfigEmailContainerData' => [
                    'model' => 'app\models\test',
                    'host' => '',
                    'user' => '[...user..]',
                    'password' => '.........',
                    'ssl' => 'SSL',
            'EmailContainers' => [

  • add to config/console.php under modules d3yii2/d3files with identical setings as in config.web.php
  • migration configuration. Add to console parameters migration path
    'yii.migrations' => [
  • do migration
    yii migrate
  • For reading emails add yii command to console config 'controllerMap' => [ 'd3pop3' => 'd3yii2\d3pop3\command\D3Pop3Controller', ]
  • create to d3yii2/d3files defined upload directory subdirectory D3pop3Email


By Config

In configuration under 'ConfigEmailContainerData' set: * POP3 connection data, * model with namespace for attaching emails * model field name, where search email to field value for ataching email