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: sendmail.php
<?php error_reporting(E_ALL); ini_set('display_errors', 1); /** * This example shows sending a message using a local sendmail binary. */ require '../PHPMailerAutoload.php'; $fromname=$_POST['name']; $to="heerak@kispl.in"; $toname="KISPL"; $reply="KISPL"; $replyname="heerak@kispl.in"; $subject='Job Application Rcvd'; $msg = ''; // start with a blank message $msg .= 'Name: ' . $_POST['name'] . "<br>"; $msg .= 'Message: ' . $_POST['message'] . "<br>"; $msg .= 'Email: ' . $_POST['email'] . "<br>"; $msg .= 'Mobile No.: ' . $_POST['mobile']."<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($_FILES['userfile']['tmp_name'],$_FILES['userfile']['name']); //send the message, check for errors if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { //header('Location: ../../index.php'); echo "<script>window.location='../../index.php'</script>"; }
Save
Cancel