1. Go to this page and download the library: Download nette/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/ */
nette / mail example snippets
$mail = new Nette\Mail\Message;
$mail->setFrom('John <[email protected]>')
->addTo('[email protected]')
->addTo('[email protected]')
->setSubject('Order Confirmation')
->setBody("Hello, Your order has been accepted.");
$mail->setHtmlBody('<p>Hello,</p><p>Your order has been accepted.</p>');
// automatically adds /path/to/images/background.gif to the email
$mail->setHtmlBody(
'<b>Hello</b> <img src="background.gif">',
'/path/to/images',
);
// inserts the file /path/to/example.zip into the email under the name example.zip
$mail->addAttachment('/path/to/example.zip');
// inserts the file /path/to/example.zip into the email under the name info.zip
$mail->addAttachment('info.zip', file_get_contents('/path/to/example.zip'));
// attaches new example.txt file contents "Hello John!"
$mail->addAttachment('example.txt', 'Hello John!');