BossBey File Manager
PHP:
7.4.33
OS:
Linux
User:
root
Root
/
home
/
vssraipur
/
public_html
/
PHPMailer
/
examples
📤 Upload
📝 New File
📁 New Folder
Close
Editing: sendmail1.php
<?php // echo '<pre>'; print_r($_POST); die(); error_reporting(E_ALL); ini_set('display_errors', 1); /** * This example shows sending a message using a local sendmail binary. */ require '../PHPMailerAutoload.php'; $fromname="KISPL"; $to=$_POST['bemail']; $toname="KISPL"; $reply="KISPL"; $replyname="heerak@kispl.in"; $subject='brochure has been sent'; $msg = ''; // start with a blank message $msg .= 'Email: ' . $_POST['bemail'] . "<br>"; $mail = new PHPMailer; $mail->isSMTP(); $mail->Host = 'localhost'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'heerak@kispl.in'; // SMTP username $mail->Password = 'heerak123456'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; $mail->IsHTML(true); $mail->setFrom($replyname, ''.$reply.''); $mail->addReplyTo($replyname, ''.$reply.''); $mail->addAddress($to, $toname); $mail->Subject = $subject; $mail->Body= $msg; $mail->AltBody = 'This is a plain-text message body'; $mail->addAttachment('pdf/skoolroom-brochure.pdf'); $mail->addAttachment('pdf/pdfurl-guide.pdf'); //send the message, check for errors if (!$mail->send()) { $setmsg = "Mailer Error: " . $mail->ErrorInfo; $error = 'Yes'; } else { //header('Location: ../../index.php'); $setmsg = "Mail send successfully."; $error = 'No'; } $cll['msg'] = $setmsg; $cll['error'] = $error; echo json_encode($cll, true);
Save
Cancel