This repository was archived by the owner on May 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMail.php
58 lines (45 loc) · 1.35 KB
/
Mail.php
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
namespace SolrKDE;
require_once './phemail/vendor/autoload.php';
class Mail {
private $fileName;
private $received;
private $from;
private $subject;
private $content;
private $mailDate;
private $receivedSpf;
function setFromFile($direcrtoryName, $fileName) {
$parser = new \Phemail\MessageParser();
$this->fileName = $fileName;
$this->mailMessage = $parser->parse($direcrtoryName . '/' . $fileName);
$this->subject = $this->mailMessage->getHeaderValue('subject');
$this->content = $this->mailMessage->getContents();
$this->mailDate = $this->mailMessage->getHeaderValue('date');
$this->from = $this->mailMessage->getHeaderValue('from');
$this->received = $this->mailMessage->getHeaderValue('received-spf');
}
// function getJson($file) {
// //..construct json response from properties
// return jsonMail;
// }
public function getFileName() {
return $this->fileName;
}
public function getReceived() {
return $this->received;
}
public function getFrom() {
return $this->from;
}
public function getSubject() {
return $this->subject;
}
public function getContent() {
return $this->content;
}
public function getMailDate() {
return $this->mailDate;
}
}
?>