1. Go to this page and download the library: Download originphp/email library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
useOrigin\Email\Email;
$Email = new Email();
$Email->to('somebody@originphp.com')
->from('me@originphp.com')
->subject('This is a test')
->textMessage('This is the text content')
->send();
useOrigin\Email\Email;
$Email = new Email();
$Email->to('somebody@originphp.com')
->from('me@originphp.com')
->subject('This is a test')
->textMessage('This is the text content')
->htmlMessage('<p>This is the html content</p>')
->format('both')
->send();
useOrigin\Email\Email;
$Email = new Email());
$Email->to('somebody@originphp.com')
->from('me@originphp.com')
->subject('This is a test')
->htmlMessage('<p>This is the html content</p>')
->format('html')
->send();
useOrigin\Email\Email;
$Email = new Email();
$Email->to('somebody@originphp.com')
->from('me@originphp.com')
->subject('This is a test')
->textMessage('This is the text content')
->addAttachment($filename1)
->addAttachment($filename2,'Logo.png')
->send();
useOrigin\Email\Email;
$Email = new Email('gmail');
useOrigin\Email\Email;
$Email = new Email();
$Email->to('somebody@originphp.com')
->from('me@originphp.com')
->subject('This is a test')
->textMessage('This is the text content')
->account('gmail')
->send();