PHP Bulk Email Sender
by JeremyPhisher - Tuesday February 4, 2025 at 06:41 PM
#1
I get mad watching people selling something so simple all the time. Here is my program that can be used for Bulk email.
It will work with most combolists and can be easily changed to accept different formats. The letter that is sent with the emails only needs to have {first_name} and {last_name} in it. And the script will automatically send to the names associated with the email.

<?php // Include PHPMailer classes use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; // Load PHPMailer require 'PHPMailer/src/Exception.php'; require 'PHPMailer/src/PHPMailer.php'; require 'PHPMailer/src/SMTP.php'; // SMTP Configuration from the first script $SMTP_HOST = 'smtp.gmail.com';  // Set the SMTP server to send through (same as the first script) $SMTP_USER = 'gmail address'; // Your email from the first script $SMTP_PASS = 'app password'; // Your email password from the first script $SMTP_PORT = 465; // TCP port to connect to; 465 for SSL (same as the first script) // Load email template function loadEmailTemplate($filename) {     return file_get_contents($filename); } // Send email function function sendEmail($firstName, $lastName, $email, $emailTemplate) {     global $SMTP_HOST, $SMTP_USER, $SMTP_PASS, $SMTP_PORT;     $mail = new PHPMailer(true);         try {         // Server settings         $mail->isSMTP();         $mail->Host      = $SMTP_HOST;         $mail->SMTPAuth  = true;         $mail->Username  = $SMTP_USER;         $mail->Password  = $SMTP_PASS;         $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;         $mail->Port      = $SMTP_PORT;         // Recipients         $mail->setFrom($SMTP_USER, 'Account Security');         $mail->addAddress($email, "$firstName $lastName");         // Email Content         $subject = "Suspicious Account Activity";         $body = str_replace(["{First_name}", "{Last_name}"], [$firstName, $lastName], $emailTemplate);         $mail->isHTML(true);         $mail->Subject = $subject;         $mail->Body    = $body;         // Send the email         $mail->send();         echo "✅ Email successfully sent to $firstName $lastName at $email" . PHP_EOL;     } catch (Exception $e) {         echo "❌ Failed to send email to $email: {$mail->ErrorInfo}" . PHP_EOL;     } } // Process CSV file and send emails function processFile($filename, $emailTemplate) {     if (($file = fopen($filename, "r")) !== FALSE) {         while (($row = fgetcsv($file)) !== FALSE) {             if (count($row) >= 3) { // Ensure at least Name & Email exist                 $nameParts = explode(" ", trim($row[0]), 2);                 $firstName = $nameParts[0] ?? "Valued";                 $lastName = $nameParts[1] ?? "Customer";                 $email = trim($row[2]);                 if (filter_var($email, FILTER_VALIDATE_EMAIL)) {                     sendEmail($firstName, $lastName, $email, $emailTemplate);                 } else {                     echo "⚠ Skipping invalid email: $email" . PHP_EOL;                 }             }         }         fclose($file);     } else {         echo "❌ Failed to open the file: $filename" . PHP_EOL;     } } // Load the email template $emailTemplate = loadEmailTemplate("paypal.html"); // Process the file and send emails $file_name = "control.txt"; // Ensure this file exists processFile($file_name, $emailTemplate); ?>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Free .edu Email via Maricopa College — No Enrollment, Just the Email spanko73 57 1,015 07-03-2026, 12:30 PM
Last Post: cookky1
  1K Paypal accounts email+password am-jalaim 158 13,820 06-26-2026, 02:22 AM
Last Post: bronnyzy
  6x @Windows.com Email Access Cracked 9 478 02-07-2026, 10:46 PM
Last Post: seederz
  FREE BEST EMAIL SERVICE GLOWINGNIGGA 5 413 08-03-2025, 08:47 PM
Last Post: Utmainfo
  NetFlix Cookies Checker [php tool] iisomeone 17 951 03-22-2025, 06:17 PM
Last Post: h3x00000



 Users browsing this thread: 1 Guest(s)