@@ -121,19 +121,26 @@ class Message
121121 protected $ from ;
122122
123123 /**
124- * This is an array of arrays that contain information about the addresses the email was cc'd to.
124+ * This is an array of arrays that contains information about the addresses the email was sent to.
125125 *
126126 * @var array
127127 */
128128 protected $ to ;
129129
130130 /**
131- * This is an array of arrays that contain information about the addresses the email was cc'd to.
131+ * This is an array of arrays that contains information about the addresses the email was cc'd to.
132132 *
133133 * @var array
134134 */
135135 protected $ cc ;
136136
137+ /**
138+ * This is an array of arrays that contains information about the addresses the email was bcc'd to.
139+ *
140+ * @var array
141+ */
142+ protected $ bcc ;
143+
137144 /**
138145 * This is an array of arrays that contain information about the addresses that should receive replies to the email.
139146 *
@@ -200,6 +207,9 @@ protected function loadMessage()
200207 if (isset ($ headers ->cc ))
201208 $ this ->cc = $ this ->processAddressObject ($ headers ->cc );
202209
210+ if (isset ($ headers ->bcc ))
211+ $ this ->bcc = $ this ->processAddressObject ($ headers ->bcc );
212+
203213 $ this ->from = $ this ->processAddressObject ($ headers ->from );
204214 $ this ->replyTo = isset ($ headers ->reply_to ) ? $ this ->processAddressObject ($ headers ->reply_to ) : $ this ->from ;
205215
@@ -316,13 +326,13 @@ public function getMessageBody($html = false)
316326 * This function returns either an array of email addresses and names or, optionally, a string that can be used in
317327 * mail headers.
318328 *
319- * @param string $type Should be 'to', 'cc', 'from', or 'reply-to'.
329+ * @param string $type Should be 'to', 'cc', 'bcc', ' from', or 'reply-to'.
320330 * @param bool $asString
321331 * @return array|string|bool
322332 */
323333 public function getAddresses ($ type , $ asString = false )
324334 {
325- $ addressTypes = array ('to ' , 'cc ' , 'from ' , 'reply-to ' );
335+ $ addressTypes = array ('to ' , 'cc ' , 'bcc ' , ' from ' , 'reply-to ' );
326336
327337 if (!in_array ($ type , $ addressTypes ) || !isset ($ this ->$ type ) || count ($ this ->$ type ) < 1 )
328338 return false ;
0 commit comments