blob: 83dbd17f89fc55c0b881835772ec903c4a9b4b06 [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001<?php
2
3declare(strict_types=1);
4
5namespace Ddeboer\Imap\Message;
6
7interface BasicMessageInterface extends PartInterface
8{
9 /**
10 * Get raw message headers.
11 */
12 public function getRawHeaders(): string;
13
14 /**
15 * Get the raw message, including all headers, parts, etc. unencoded and unparsed.
16 *
17 * @return string the raw message
18 */
19 public function getRawMessage(): string;
20
21 /**
22 * Get message headers.
23 */
24 public function getHeaders(): Headers;
25
26 /**
27 * Get message id.
28 *
29 * A unique message id in the form <...>
30 */
31 public function getId(): ?string;
32
33 /**
34 * Get message sender (from headers).
35 */
36 public function getFrom(): ?EmailAddress;
37
38 /**
39 * Get To recipients.
40 *
41 * @return EmailAddress[] Empty array in case message has no To: recipients
42 */
43 public function getTo(): array;
44
45 /**
46 * Get Cc recipients.
47 *
48 * @return EmailAddress[] Empty array in case message has no CC: recipients
49 */
50 public function getCc(): array;
51
52 /**
53 * Get Bcc recipients.
54 *
55 * @return EmailAddress[] Empty array in case message has no BCC: recipients
56 */
57 public function getBcc(): array;
58
59 /**
60 * Get Reply-To recipients.
61 *
62 * @return EmailAddress[] Empty array in case message has no Reply-To: recipients
63 */
64 public function getReplyTo(): array;
65
66 /**
67 * Get Sender.
68 *
69 * @return EmailAddress[] Empty array in case message has no Sender: recipients
70 */
71 public function getSender(): array;
72
73 /**
74 * Get Return-Path.
75 *
76 * @return EmailAddress[] Empty array in case message has no Return-Path: recipients
77 */
78 public function getReturnPath(): array;
79
80 /**
81 * Get date (from headers).
82 */
83 public function getDate(): ?\DateTimeImmutable;
84
85 /**
86 * Get message size (from headers).
87 *
88 * @return null|int|string
89 */
90 public function getSize();
91
92 /**
93 * Get message subject (from headers).
94 */
95 public function getSubject(): ?string;
96
97 /**
98 * Get message In-Reply-To (from headers).
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020099 *
100 * @return string[]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100101 */
102 public function getInReplyTo(): array;
103
104 /**
105 * Get message References (from headers).
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200106 *
107 * @return string[]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100108 */
109 public function getReferences(): array;
110
111 /**
112 * Get body HTML.
113 *
114 * @return null|string Null if message has no HTML message part
115 */
116 public function getBodyHtml(): ?string;
117
118 /**
119 * Get body text.
120 */
121 public function getBodyText(): ?string;
122
123 /**
124 * Get attachments (if any) linked to this e-mail.
125 *
126 * @return AttachmentInterface[]
127 */
128 public function getAttachments(): array;
129
130 /**
131 * Does this message have attachments?
132 */
133 public function hasAttachments(): bool;
134}