BossBey File Manager
PHP:
7.4.33
OS:
Linux
User:
hmchvvva
Root
/
home
/
hmchvvva
/
public_html
/
vistagroup-html
📤 Upload
📝 New File
📁 New Folder
Close
Editing: mailer.php
<?php //require_once "vendor/autoload.php"; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'PHPMailer-6.0.5/src/Exception.php'; require 'PHPMailer-6.0.5/src/PHPMailer.php'; require 'PHPMailer-6.0.5/src/SMTP.php'; /*if (!function_exists('base_url')) { function base_url($atRoot=FALSE, $atCore=FALSE, $parse=FALSE){ if (isset($_SERVER['HTTP_HOST'])) { $http = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http'; $hostname = $_SERVER['HTTP_HOST']; $dir = str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); $core = preg_split('@/@', str_replace($_SERVER['DOCUMENT_ROOT'], '', realpath(dirname(__FILE__))), NULL, PREG_SPLIT_NO_EMPTY); $core = $core[0]; $tmplt = $atRoot ? ($atCore ? "%s://%s/%s/" : "%s://%s/") : ($atCore ? "%s://%s/%s/" : "%s://%s%s"); $end = $atRoot ? ($atCore ? $core : $hostname) : ($atCore ? $core : $dir); $base_url = sprintf( $tmplt, $http, $hostname, $end ); } else $base_url = 'http://localhost:8080'; if ($parse) { $base_url = parse_url($base_url); if (isset($base_url['path'])) if ($base_url['path'] == '/') $base_url['path'] = ''; } return $base_url; } }*/ $base_url = 'http://evoguedigital.com/vistagroup-html'; $website_name='Vista Group'; $name = $_POST['name']; // required $email = $_POST['email']; // required $company = $_POST['company']; // required $country = $_POST['country']; // required $subject = 'Vista Group Get in Touch Form Submission'; $message = $_POST['message']; // required //PHPMailer Object $mail = new PHPMailer; //From email address and name $mail->From = "info@vistagroup.ae"; $mail->FromName = $website_name; //To address and name sid@itdepartmentinc.ca $mail->addAddress("developer@code9tech.com", ""); //$mail->addAddress("info@vistagroup.ae", ""); //$mail->addAddress("robin@code9tech.com", ""); //Address to which recipient will reply //CC and BCC //$mail->addCC("cc@example.com"); //$mail->addBCC("bcc@example.com"); //Send HTML or Plain Text email $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = '<div><div style="width:100%;min-height:100%;margin:10px auto;padding:0;background-color:#f3f3f3;font-family:Arial,Tahoma,Verdana,sans-serif;font-weight:299px;font-size:13px;text-align:center" bgcolor="#ffffff"><table width="100%" cellspacing="0" cellpadding="0" style="max-width:600px"> <tbody> <tr> <td height="30" colspan="2" style="width:100%;padding:1em 0;background: #fff;border:1px solid #e6e6e6"> <div style="padding:2.5px 1em;padding-bottom:3px;text-align:center"> <img src='.$base_url."/img/logo.png".'> </div> </td> </tr> </tbody> </table> <table width="100%" cellspacing="0" cellpadding="0" style="max-width:600px;height:5px;background:#ccc"> <tbody> <tr> <td valign="top" align="center" width="600"> </td> </tr> </tbody> </table> <table width="100%" cellspacing="0" cellpadding="0" style="max-width:600px;border-left:solid 1px #e6e6e6;border-right:solid 1px #e6e6e6"> <tbody> <tr style="background-color:rgb(251,251,251)"> <th align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">Name</th> <td align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%"> '.$name. '</td> </tr> <tr style="background-color:rgb(251,251,251)"> <th align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">Email</th> <td align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">'.$email.'</td> </tr> <tr style="background-color:rgb(251,251,251)"> <th align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">Company</th> <td align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">'.$company.'</td> </tr> <tr style="background-color:rgb(251,251,251)"> <th align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">Country</th> <td align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">'.$country.'</td> </tr> <tr style="background-color:rgb(251,251,251)"> <th align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">Message</th> <td align="left" valign="top" style="color:#545151;border-bottom:1px solid #e6e6e6;border-right:1px solid #e6e6e6;padding:15px;width:50%">'.$message.'</td> </tr> <tr style="max-width:600px;border:solid 1px #e6e6e6;border-top:none"> <td colspan="2" valign="top" align="center" style="text-align:center;background-color:#f3f3f3; margin:0 auto;clear:both;padding:15px 40px" bgcolor="#F9F9F9"> <p style="padding:0;margin:0 0 7px 0"> <a title="'.$website_name.'" style="text-decoration:none;color:#a4832c" href="'.$base_url.'" target="_blank" ><span style="color:black;font-size:12px;text-transform:uppercase;font-weight:bold;letter-spacing:5px"><span >'.$website_name.' Ltd.</span></span></a> </p> </td> </tr> </tbody> </table></div></div>'; $whitelist = array( '127.0.0.1', '::1' ); if(!in_array($_SERVER['REMOTE_ADDR'], $whitelist)){ // not valid if($name && $email && $company && $country){ if(!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent successfully"; } } } else{ $file = fopen("mail.html","w"); fwrite($file,$mail->Body); fclose($file); echo 'Message has been sent successfully'; } ?>
Save
Cancel