PHP code example of jjaffeux / postmark-inbound-php

1. Go to this page and download the library: Download jjaffeux/postmark-inbound-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jjaffeux / postmark-inbound-php example snippets

 json
{
    "affeux/postmark-inbound-php": ">=3.0"
    }
}
 php
$inbound = new \Postmark\Inbound(file_get_contents('php://input'));
 php
stmark\Autoloader::register();

// this file should be the target of the callback you set in your postmark account
$inbound = new \Postmark\Inbound(file_get_contents('php://input'));
 php
$inbound->Subject();
$inbound->FromEmail();
$inbound->FromFull();
$inbound->FromName();
$inbound->Date();
$inbound->OriginalRecipient();
$inbound->ReplyTo();
$inbound->MailboxHash();
$inbound->Tag();
$inbound->MessageID();
$inbound->TextBody();
$inbound->HtmlBody();
$inbound->StrippedTextReply();
 php
$inbound->Headers(); //default to spam status
$inbound->Headers('X-Spam-Status');
$inbound->Headers('X-Spam-Checker-Version');
$inbound->Headers('X-Spam-Score');
$inbound->Headers('X-Spam-Tests');
$inbound->Headers('Received-SPF');
$inbound->Headers('MIME-Version');
$inbound->Headers('Received-SPF'); // pass neutral fail
$inbound->Headers('Message-ID');
 php
foreach($inbound->Recipients() as $recipient) {
	$recipient->Name;
	$recipient->Email;
}

foreach($inbound->UndisclosedRecipients() as $undisclosedRecipient) {
	$undisclosedRecipient->Name;
	$undisclosedRecipient->Email;
}
 php
foreach($inbound->Attachments() as $attachment) {
	$attachment->Name;
	$attachment->ContentType;
	$attachment->ContentLength;
	$attachment->Download('/'); //takes directory as first argument
}

$inbound->HasAttachments();
 php
$inbound->Source; //array
$inbound->Json; //raw json