PHP Email Class
1.0.0
This class allows you to send email using the PHPMailer library with SMTP.
Made By Nepcen
require_once 'path/to/Email.php';
To send an email, use the sendMail()
method. This method takes the following parameters:
$email = new Email('smtp.example.com', 'username', 'password', '587', 'tls');
$to = "[email protected]";
$subject = "Test Email";
$body = "This is a test email sent using PHPMailer.";
$from = "[email protected]";
$fromName = "Sender";
$attachments = ['/path/to/file1.jpg', '/path/to/file2.pdf'];
if($email->sendMail($to, $subject, $body, $from, $fromName, $attachments)) {
echo "Email sent successfully with attachments.";
} else {
echo "Failed to send email.";
}
You can always contribute to the class by making pull requests and adding more feature or fixing bugs.
This class is open-sourced software licensed under the MIT license.