To encode an e-mail address like, one could simply encode However to ensure it is recognized as an e-mail address, it is advisable to create a proper mailto: URI from the address:

This class helps to enforce the above rule.


use Da\QrCode\QrCode;
use Da\QrCode\Format\MailtoFormat; 

$format = new MailToFormat(['email' => '']);

$qrCode = new QrCode($format);

header('Content-Type: ' . $qrCode->getContentType());
echo $qrCode->writeString();

© 2amigos 2013-2023