Собственно код:
CODE (php):
скопировать код в буфер обмена
скопировать код в буфер обмена
- require_once("functions.php");
- $mail_login = "***@yandex.ru";
- $mail_password = "***";
- $mail_imap = "{imap.yandex.ua:143/imap/novalidate-cert}";
- if(!$connection){
- echo("Ошибка соединения с почтой - ".$mail_login);
- exit;
- }else{
- for($i = 1; $i <= $msg_num; $i++){
- $mails_data[$i]["date"] = $msg_header->MailDate;
- foreach($msg_header->from as $data){
- $mails_data[$i]["from"] = $data->mailbox."@".$data->host;
- }
- $mails_data[$i]["title"] = get_imap_title($msg_header->subject);
- $body = "";
- $recursive_data = recursive_search($msg_structure);
- if($recursive_data["encoding"] == 0 || $recursive_data["encoding"] == 1){
- $body = $msg_body;
- }
- if($recursive_data["encoding"] == 4){
- $body = structure_encoding($recursive_data["encoding"], $msg_body);
- }
- if($recursive_data["encoding"] == 3){
- $body = structure_encoding($recursive_data["encoding"], $msg_body);
- }
- if($recursive_data["encoding"] == 2){
- $body = structure_encoding($recursive_data["encoding"], $msg_body);
- }
- if(!check_utf8($recursive_data["charset"])){
- $body = convert_to_utf8($recursive_data["charset"], $msg_body);
- }
- }
- }