Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| Both sides previous revision Vorhergehende Überarbeitung | |||
|
php:imap [2022/08/17 10:39] webproducer |
php:imap [2022/08/17 10:49] (aktuell) webproducer SSL ergänzt |
||
|---|---|---|---|
| Zeile 15: | Zeile 15: | ||
| private $username = ''; | private $username = ''; | ||
| private $password = ''; | private $password = ''; | ||
| + | private $port = 143; | ||
| + | private $type = 'IMAP'; | ||
| + | private $ssl = true; | ||
| /** | /** | ||
| Zeile 23: | Zeile 26: | ||
| public function getEmails( $onlyUnread = false ) | public function getEmails( $onlyUnread = false ) | ||
| { | { | ||
| - | $mailbox = sprintf( "{%s:143}INBOX", $this->server ); | + | $ssl = ''; |
| + | |||
| + | if( $this->ssl ) | ||
| + | { | ||
| + | $ssl = '/ssl'; | ||
| + | } | ||
| + | |||
| + | $mailbox = sprintf( "{%s:%d/%s%s/novalidate-cert}INBOX", $this->server, $this->port, $this->type, $ssl ); | ||
| $this->stream = imap_open( $mailbox, $this->username, $this->password ); | $this->stream = imap_open( $mailbox, $this->username, $this->password ); | ||
| $MC = imap_check( $this->stream ); | $MC = imap_check( $this->stream ); | ||