Wednesday, September 25, 2024

isSMTP(); // Set mailer to use SMTP $mail->Host = 'localhost'; // Specify local SMTP server $mail->SMTPAuth = false; // Disable SMTP authentication $mail->SMTPSecure = ''; // No encryption needed $mail->Port = 25; // SMTP port for local server // Sender settings $mail->setFrom('ticket@shipping.com', 'Best IPTV'); // Change this to your email address $mail->addReplyTo('iptvwhite139@gmail.com', 'Nordic'); // Reply-to address // Campaign ID $campaign_id = 'YH13'; // Set your campaign ID here // Load email template $emailBody = file_get_contents('email.html'); // Read email list and send emails $emailList = file('list.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach ($emailList as $email) { // Validate email format if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "Invalid email address skipped: $email\n"; continue; // Skip invalid email and move to the next } // Replace placeholders with dynamic content (email and campaign ID) $personalizedBody = str_replace('{{email}}', urlencode($email), $emailBody); $personalizedBody = str_replace('{{campaign_id}}', urlencode($campaign_id), $personalizedBody); $personalizedBody = str_replace('{url}', urlencode('https://google.com'), $personalizedBody); // Update with actual URL // Set email body $mail->Body = $personalizedBody; $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'Stream for 24 Months with Our Best IPTV Offer!'; // Email subject $mail->addAddress($email); // Add recipient // Send email if ($mail->send()) { echo "Message sent to: $email\n"; } else { echo "Message could not be sent to: $email. Mailer Error: {$mail->ErrorInfo}\n"; } // Clear all recipients for the next email $mail->clearAddresses(); } } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } ?>

No comments:

Blog Archive