Skip to content

Commit

Permalink
Update index.md #221
Browse files Browse the repository at this point in the history
  • Loading branch information
zbateson committed Aug 28, 2023
1 parent 81a12ca commit 399a349
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ $subject = $message->getHeaderValue('Subject');
$text = $message->getTextContent();
$html = $message->getHtmlContent();
$from = $message->getHeader('From');
$fromName = $from->getName();
$fromName = $from->getPersonName();
$fromEmail = $from->getEmail();

$to = $message->getHeader('To');
// first email address can be accessed directly
$firstToName = $to->getName();
$firstToName = $to->getPersonName();
$firstToEmail = $to->getEmail();

foreach ($to->getAllAddresses() as $addr) {
$toName = $to->getName();
$toName = $to->getPersonName();
$toEmail = $to->getEmail();
}

Expand Down Expand Up @@ -179,7 +179,7 @@ if ($to->hasAddress('[email protected]')) {
}
// or to loop over AddressPart objects:
foreach ($to->getAddresses() as $address) {
echo $address->getName() . ' ' . $address->getEmail();
echo $address->getPersonName() . ' ' . $address->getEmail();
}
```

Expand Down

0 comments on commit 399a349

Please sign in to comment.