Create, bind and deliver each message code safely
-
1
Keep the key outside public files
Store the VerifySeal API key in a server environment variable such as VERIFYSEAL_EMAIL_API_KEY. Never commit it to a repository or place it in public_html, JavaScript or a template.
-
2
Create the Message-ID yourself
Before PHPMailer prepares the message, create a globally unique value such as <random@example.com> and assign that exact value to the PHPMailer MessageID property. Use a domain controlled by the sender.
-
3
Request the VEM code
Call the VerifySeal endpoint from PHP with the same Message-ID and a stable application send ID. Require a successful JSON response before allowing a High Security message to continue.
-
4
Add both message formats
Add message_code.header as a custom header. Append html_footer to Body and text_footer to AltBody so both MIME alternatives identify the same code.
-
5
Send through the final signer
Call send only after the content is complete. If PHPMailer signs DKIM locally, configure signing on that same instance. If an SMTP provider signs downstream, confirm it preserves Message-ID and the footer.
-
6
Test the received source
Inspect a message received outside your network. Confirm the final Message-ID exactly matches the one submitted, X-VerifySeal-Code is present, the verification link opens, and DKIM/DMARC pass.