PHP code example of sqginfo / sped-mail

1. Go to this page and download the library: Download sqginfo/sped-mail 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/ */

    

sqginfo / sped-mail example snippets


$resp = Mail::sendMail($config, $xml, $pdf, $addresses, $template);

$config = new stdClass();
$config->mail->host = 'smtp.test.com.br';
$config->mail->user = '[email protected]';
$config->mail->password = 'senha';
$config->mail->secure = 'tls';
$config->mail->port = 587;
$config->mail->from = '[email protected]';
$config->mail->fantasy = 'Test Ltda';
$config->mail->replyTo = '[email protected]';
$config->mail->replyName = 'Vendas';

$xml = '../nfe.xml';

$xml = file_get_contents('../nfe.xml');

$pdf = '../nfe.pdf';

$pdf = file_get_contents('../nfe.pdf');

$addresses = ['[email protected]'];

$template = '<p>Meu HTML {emitente} .... ';