Licensing
All the code here is covered by the PHPGuru license. A short summary is that for any sort of commercial use there is a small one-off licensing fee to pay, and for charity and educational use there is a reduced license fee.
You can read more about licensing here (where there's also a link to Google Checkout).
SMTP mail sending utility for PHP5
This is a utility for PHP5 for connecting to and sending email via SMTP servers.
- The smtp.php file: smtp.php
- The example file: example.php
- The archive: Download
Code sample
try {
$smtp = new SMTP($server, $port, $helo, $auth, $user, $pass);
$smtp->dbug = true;
$smtp->Connect();
$smtp->Send(array($recipient), // Array of recipient addresses
$from, // SMTP From address
array('Subject' => 'The subject', // The subject of the email
'To' => $recipient, // The recipient of the email
'From' => $from), // The emails headers
$message); // The emails body
} catch (SMTPException $e) {
echo $e->GetMessage();
}