public function actionPdf() { mailsend("*****@*****.**", "*****@*****.**", "hi", "hello", "./assets/pdf/abc.pdf"); //$mPDF1 = Yii::app()->ePdf->mpdf(); //$mPDF1->WriteHTML($this->render('mail', array(), true)); //$mPDF1->Output("./assets/pdf/abc.pdf","F"); }
$result = mysqli_query($connection, $sql); $table_record = mysqli_fetch_array($result); $db_userId = $table_record['userId']; // $user_name = stripslashes($user_name); // $password = stripslashes($password); // $user_name = mysql_real_escape_string($user_name); // $password = mysql_real_escape_string($password); $query = "insert into userinfo (firstName, lastName, emailAddress, password, contact) VALUES ('{$firstName}','{$lastName}','{$user_name}','{$password}',{$contact})"; try { $result = mysqli_query($connection, $query); if ($result) { $_SESSION['loginUser'] = $user_name; $_SESSION['loginId'] = $db_userId; $subjects = "Welcome To Honliz.com"; $body = '<a href="http://www.Honliz.com"><img width="300px" height="100px" alt="PHPMailer" src="cid:my-attach"></a>' . '<br>' . "Welcome and thank you for registering at Honliz Fashion & Designs!" . '<br><br>' . "Your account has now been created and you can log in by using your email address and" . '<br>' . " password by visiting our website or at the following URL:" . '<br>' . "<a href='http://honliz.com/index.php'>http://Honliz.com/index.php</a>" . '<br><br>' . "Upon logging in, you will be able to access other services including reviewing past orders," . '<br>' . "printing invoices and editing your account information." . '<br>' . "Thanks," . '<br>' . "Honliz Fashion & Designs" . '<br>' . "<img src='photo/Honliz logo' /><br/>"; mailsend($subjects, $user_name, $body, $firstName, $lastName); header("location: index.php"); } else { header("location: register.php"); throw new Exception("Problem in Query"); } } catch (Exception $e) { $e->getMessage(); } } } function mailsend($subjects, $emailto, $body, $fName, $lName) { $mail = new PHPMailer(); $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
public function actionSend() { $plan_id = "880dcb73-7bc2-11e5-bc4d-3c07717072c4"; $plan_model = Plans::model()->find(array('condition' => 'id = "' . $plan_id . '" ')); $data['plan_name'] = $plan_model->name; $body = $this->renderPartial("quotation_mail_template", $data, true); mailsend("*****@*****.**", "*****@*****.**", "hi", $body); }
if (isset($_POST["submit1"])) { $sub = $_POST["article_name"]; $f = $_FILES["file"]['name']; $file1 = realpath($f); $path = "newsletter/"; include "dbConnect.php"; $tmp = $_FILES['file']['tmp_name']; if (move_uploaded_file($tmp, $path . $f)) { $query = "SELECT firstName,lastName,emailAddress FROM `userinfo` "; $result = mysqli_query($CONNECTION, $query); if ($result) { if ($result->num_rows > 0) { while ($notify = mysqli_fetch_assoc($result)) { $body = "Dear " . $notify["firstName"] . " " . $notify["lastName"] . "," . '<br><br>' . $_POST["body"] . '<br><br>' . "Regards," . '<br><br>' . "<a href='www.electroshop.pk'>ElectroShop.pk</a>"; $file1 = $path . $f; mailsend($sub, $notify["emailAddress"], $file1, $body, $notify["firstName"], $notify["lastName"]); } } } echo "Mail has been sent!"; echo "<script>location='phpMail.php'</script>"; } } function mailsend($subjects, $emailto, $file1, $body, $fName, $lName) { $mail = new PHPMailer(); $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers $mail->isSMTP(); $mail->SMTPAuth = true; // Enable SMTP authentication