@@ -923,7 +923,7 @@ public function getMailHeader($mailId)
923923 if (isset ($ head ->to )) {
924924 $ toStrings = [];
925925 foreach ($ head ->to as $ to ) {
926- if (!empty ($ to ->mailbox ) && !empty (trim ($ to ->host ))) {
926+ if (isset ( $ to -> mailbox ) && !empty (trim ( $ to ->mailbox )) && isset ( $ to -> host ) && !empty (trim ($ to ->host ))) {
927927 $ toEmail = strtolower ($ to ->mailbox .'@ ' .$ to ->host );
928928 $ toName = (isset ($ to ->personal ) and !empty (trim ($ to ->personal ))) ? $ this ->decodeMimeStr ($ to ->personal , $ this ->getServerEncoding ()) : null ;
929929 $ toStrings [] = $ toName ? "$ toName < $ toEmail> " : $ toEmail ;
@@ -935,7 +935,7 @@ public function getMailHeader($mailId)
935935
936936 if (isset ($ head ->cc )) {
937937 foreach ($ head ->cc as $ cc ) {
938- if (!empty (trim ($ cc ->mailbox )) && !empty (trim ($ cc ->host ))) {
938+ if (isset ( $ cc -> mailbox ) && !empty (trim ($ cc ->mailbox )) && isset ( $ cc -> host ) && !empty (trim ($ cc ->host ))) {
939939 $ ccEmail = strtolower ($ cc ->mailbox .'@ ' .$ cc ->host );
940940 $ ccName = (isset ($ cc ->personal ) and !empty (trim ($ cc ->personal ))) ? $ this ->decodeMimeStr ($ cc ->personal , $ this ->getServerEncoding ()) : null ;
941941 $ ccStrings [] = $ ccName ? "$ ccName < $ ccEmail> " : $ ccEmail ;
@@ -946,7 +946,7 @@ public function getMailHeader($mailId)
946946
947947 if (isset ($ head ->bcc )) {
948948 foreach ($ head ->bcc as $ bcc ) {
949- if (!empty (trim ($ bcc ->mailbox )) && !empty (trim ($ bcc ->host ))) {
949+ if (isset ( $ bcc -> mailbox ) && !empty (trim ($ bcc ->mailbox )) && isset ( $ bcc -> host ) && !empty (trim ($ bcc ->host ))) {
950950 $ bccEmail = strtolower ($ bcc ->mailbox .'@ ' .$ bcc ->host );
951951 $ bccName = (isset ($ bcc ->personal ) and !empty (trim ($ bcc ->personal ))) ? $ this ->decodeMimeStr ($ bcc ->personal , $ this ->getServerEncoding ()) : null ;
952952 $ bccStrings [] = $ bccName ? "$ bccName < $ bccEmail> " : $ bccEmail ;
@@ -957,7 +957,7 @@ public function getMailHeader($mailId)
957957
958958 if (isset ($ head ->reply_to )) {
959959 foreach ($ head ->reply_to as $ replyTo ) {
960- if (!empty (trim ($ replyTo ->mailbox )) && !empty (trim ($ replyTo ->host ))) {
960+ if (isset ( $ replyTo -> mailbox ) && !empty (trim ($ replyTo ->mailbox )) && isset ( $ replyTo -> host ) && !empty (trim ($ replyTo ->host ))) {
961961 $ replyToEmail = strtolower ($ replyTo ->mailbox .'@ ' .$ replyTo ->host );
962962 $ replyToName = (isset ($ replyTo ->personal ) and !empty (trim ($ replyTo ->personal ))) ? $ this ->decodeMimeStr ($ replyTo ->personal , $ this ->getServerEncoding ()) : null ;
963963 $ replyToStrings [] = $ replyToName ? "$ replyToName < $ replyToEmail> " : $ replyToEmail ;
0 commit comments