Ticket #737: imapAppend.php

File imapAppend.php, 1.7 KB (added by amuller, 14 years ago)
Line 
1                // http://tools.ietf.org/html/rfc3501
2                function _imap_append($mailbox, $uid, $message, $flags, $internal_date)
3                {
4                        if($this->put_line($this->tag . " APPEND $mailbox $flags $internal_date {".$uid."}" ))
5                        {
6
7                                $response_append=$this->get_server_responce();
8                                if($response_append != '+ Ready for literal data')
9                                {
10                                        $this->error= "Error : $response_append !<br>";
11                                        return false;
12                                }
13                        }
14                        else
15                        {
16                                $this->error= "Error : Could not send User request. <br>";
17                                return false;
18                        }
19
20                        if($this->put_line($message))
21                        {
22                                $response_sub=$this->get_server_responce();
23                               
24                                if(substr($response_sub,strpos($response_sub,"$this->tag ")+strlen($this->tag)+1,2)!="OK")
25                                {       
26                                        $this->error= "Error : $response !<br>";
27                                        return false;
28                                }
29                        }
30                        else
31                        {
32                                $this->error= "Error : Could not send User request. <br>";
33                                return false;
34                        }
35
36                        return true;
37                }
38