-1
<?php
        $mailbox = "myServer";
        $user = "myUserName";
        $pass = "myPassWord";

        $connection = imap_open($mailbox, $user, $pass) or die ("Can't connect: " . imap_last_error());
        $list = imap_getmailboxes($connection, "myServer", "*");

        if(is_array($list)) {
            foreach($list as $key => $val) {
                echo "($key)";
                echo imap_utf7_decode($val->name) . ",";
                echo "'" . $val->delimiter . "',";
                echo $val->attributes . "<br />\n";
            }

        } else {
            echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
        }            

        /* Search mailbox for unseen messages */
        $search = imap_search($connection, 'UNSEEN');

        $header = imap_headerinfo($connection, 1);
        $emailFrom =  $header->from[0]->mailbox . "@" . $header->from[0]->host;

        if($search) {
            echo $emailFrom;
        }


        /* Close the mailbox */
        imap_close($connection);
    ?>

これは私のコードです...これまでのところ、IMAP経由で完全に接続し、電子メールを取得しています。これらの電子メールの添付ファイルを取得するにはどうすればよいですか? どんな助けでも大歓迎です!ありがとうございました

4

1 に答える 1