-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathread.php
More file actions
31 lines (24 loc) · 870 Bytes
/
read.php
File metadata and controls
31 lines (24 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
$login = $_GET['login'];
$domain = $_GET['domain'];
$id = $_GET['id'];
$url = 'https://www.1secmail.com/api/v1/?action=readMessage&login='.$login.'&domain='.$domain.'&id='.$id.'';
$json = file_get_contents($url);
$data = json_decode($json);
$html = '<div>';
$html .= '<p><strong>From:</strong> ' . $data->from . '</p>';
$html .= '<p><strong>Subject:</strong> ' . $data->subject . '</p>';
$html .= '<p><strong>Date:</strong> ' . $data->date . '</p>';
if (!empty($data->attachments)) {
$html .= '<p><strong>Attachments:</strong></p>';
$html .= '<ul>';
foreach ($data->attachments as $attachment) {
$html .= '<li>' . $attachment->filename . ' (' . $attachment->size . ' bytes)</li>';
}
$html .= '</ul>';
}
$html .= '<hr>';
$html .= '<p>' . nl2br($data->body) . '</p>';
$html .= '</div>';
echo $html;
?>