This looks like JSON. How do you get this data? If you get it from the Swift_Message object you have all kind of methods you can call on it
$to = $message->getHeaders()->get('to');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
What is the best way to filter through this data below. I am trying to access the subject in the header array but with no luck at all. I need to access the headers to cross ref in the database and update it's status. By the way this is only part of the post from Mailgun, i can access everything else except the message-headers
"message": { "headers": { "to": "Mr David Weller [email protected]", "message-id": "8326ffca98d45f37c85fe17c096f3359@www.hetasfitter.co.uk", "from": "Ramsbottom Stoves [email protected]", "subject": "Ramsbottom Stoves Survey Confirmation" }, "attachments": [], "size": 2510 },
Any help would be most welcome from a newbie...cheers!
Please or to participate in this conversation.