Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['check']) == true)
- {
- $subject = trim($_POST['subject']);
- $message = trim($_POST['message']);
- $from = 'testing@test.com';
- $i=1;
- $arrayOne = $_POST['check'];
- $arrayTwo = $_POST['fname'];
- $min = min(count($arrayOne), count($arrayTwo));
- $result = array_combine(array_slice($arrayOne, 0, $min), array_slice($arrayTwo, 0, $min));
- foreach($result as $key => $value)
- {
- echo $key. ' '. $value ;
- ini_set('display_errors',1);
- error_reporting(E_ALL);
- require 'class.phpmailer.php';
- require 'PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smt'; // Specify main/backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'com'; // SMTP username
- $mail->Password = '4'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS/SSL encryption
- $mail->Port = 587; // TCP port to connect to
- $mail->From = $from;
- $to = $key;
- $fornamn = $value;
- $confirm_code=md5(uniqid(rand()));
- $pidnew4 = $_POST['pidnew3'];
- $pnamnnew4 = $_POST['pnamnnew3'];
- $mail->IsHTML(true);
- $mail->CharSet='UTF-8';
- $mail->confirm_code=md5(uniqid(rand()));
- $mail->FromName = $from;
- $mail->addAddress($to);
- $mail->Subject = $_POST['subject'];
- $mail->Message = $_POST['message'];
- $msg = " Test!!";
- $mail->Body = $msg;
- $i++;
- $sql= "INSERT INTO temp_members_db(firstname, confirm_code, email, pid, rid, note) VALUES('$fornamn', '$confirm_code', '$to', '$pidnew4', '$i', '')";
- $b = mysqli_query($mysqli,$sql);
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo "<h2>Sent</h2><br><br>
- <br>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement