1. Go to this page and download the library: Download redsuns/email-component 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/ */
redsuns / email-component example snippets
// email-config.php
return array(
'is_smtp' => true,
'smtp_host' => 'host',
'smtp_port' => 587,
'smtp_auth' => true,
'smtp_username' => 'username',
'smtp_password' => 'pass',
'smtp_secure' => 'tls',
'is_html' => true,
'word_wrap' => 150, // se não presente o default será 150
'charset' => 'utf-8', // se não presente o default será utf-8
);
namespace Seu\Namespace;
use Redsuns\EmailComponent\BasicEmailComponent;
// Pode ser criado o array na própria variável
$config = dsuns.com.br');
$email = new BasicEmailComponent($config);
$email->setFrom($from)
->setTo($to)
->setSubject('Teste')
->setContent($content)
->send();
namespace Seu\Namespace;
use Redsuns\EmailComponent\BasicEmailComponent;
// Pode ser criado o array na própria variável
$config = 'email' => '[email protected]');
$destinatario2 = array('name' => 'Destinatario 2', 'email' => '[email protected]');
$email = new BasicEmailComponent($config);
$email->setFrom($from)
->setTo($destinatario1)
->setTo($destinatario2)
->setSubject('Teste')
->setContent($content)
->send();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.