rep7_test1.html
|
Rapid Electroplating Processxxx, Inc.
|
|
2901 W. Soffel Ave.
Melrose Park, IL 60160-1714
Phone: (708) 344 - 2504
Fax: (708) 344 - 2514
|
Please Contact Us For More Information: info@rapidelectroplating.com
Hi there before PPMailer
test: include 'REP_header.html
In PHPMailer
echo "Now Executing PHPMailer";
echo
;
// set include instead of require
//use PHPMailer.. at top of code
// use PHPMailer\PHPMailer\PHPMailer;
// use PHPMailer\PHPMailer\Exception;
// echo "included";
echo "
";
echo "ffg Executing require";
echo "
";
fff executing require_once
require_once '/home/bt9w8odb5o4p/Public_html/PHPMailer/src/Exception.php';
require_once '/PHPMailer/src/PHPMailer.php';
require_once '/PHPMailer/src/SMTP.php';
fff executed require_once
echo "require executed x3";
echo "
";
// Instantiation and passing [ICODE]true[/ICODE] enables exceptions
$name="Richard Rpids";
$email="info@rapidelectroplating.com";
$company="rep";
$request="test from php_test";
echo "entering try PHPMailer";
echo "
";
try {
echo "instantiating PHPMailer";
echo "
";
// $mail = new PHPMailer();
$mail = new /PHPMailer/PHPMailer/PHPMailer();
echo "PHPMailer instantiated";
echo "
";
//Server settings
$mail->SMTPDebug = 2; // Enable verbose debug output
echo "mail-> SMTPDebug: "." / ".$mail->SMTPDebug." / ";
echo "
";
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp1.mail.rapidelectroplating-admin.com;smtp2.mail.rapidelectroplating-admin.com.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'from_website@rapidelectroplating-admin.com'; // SMTP username
$mail->Password = 'x@E#kx2O#b9w'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, [ICODE]ssl[/ICODE] also accepted
$mail->Port = 465; // TCP port to connect to ???587
//Recipients
echo "enter recipients";
echo "
";
$mail->setFrom('from_website@rapidelectroplating-admin.com', 'Mailer');
$mail->addAddress('info@rapidelectroplating.com', 'REP_Info'); // Add a recipient
$mail->addAddress('recipient2@example.com'); // Name is optional
$mail->addReplyTo('from_website@rapidelectroplating-admin.com', 'Information');
$mail->addCC('rrapids@cox.net');//copies to
$mail->addBCC('rrapids@cox.net');// blind copies to
echo "exit recipients";
echo "
";
// Attachments (none);
// $mail->addAttachment(false); // Add attachments
// $mail->addAttachment(false); // Optional name;
echo "end attachments";
echo "
";
echo "set content";
echo "
";
echo $name ;// . " / ". $email ." / ". $company ." / ". $Request;
echo "
";
// Content
$mail->isHTML(false); // Set email format to HTML
$mail->Subject = 'Inquiry from Website';
$mail->Body = 'This is the HTML message body in bold!';
$mail->AltBody = $name . " / ". $email ." / ". $company ." / ". $Request;
echo "entering mail send";
echo "
";
$mail->send();
echo 'Message has been sent';
echo "
";
/*
*/
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
echo "
";
echo $mail->ErrorInfo;
}
echo "out of PHPMailer";
echo "
";
echo "Mail failure";
echo "
";
}
?>
before checking form variables
/*
# define variables and set to empty values
$name = $email = $gender = $comment = $website = "";
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$name = test_input($_POST["name"]);
// $name = $_POST['name'];
if (empty($_POST["name"]))
{
$nameErr = "Name is required";
} else {
$name = test_input($_POST["name"]);
// check if name only contains letters and whitespace
if (!preg_match("/^[a-zA-Z-' ]*$/",$name))
{
$nameErr = "Only letters and white space allowed";
} else {
$nameErr = "";
}
}
$email = test_input($_POST["email"]);
if (empty($_POST["email"]))
{
$emailErr = "Email is required";
} else {
$email = test_input($_POST["email"]);
// check if e-mail address is well-formed
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
{
$emailErr = "Invalid email format";
} else {
$emailErr = "";
}
}
$company = test_input($_POST["company"]);
if (empty($_POST["company"]))
{
$companyErr = "company is required";
} else {
$company = test_input($_POST["company"]);
$companyErr = "";
}
$comment = test_input($_POST["request"]);
if (empty($_POST["request"]))
{
$requestErr = "request is required";
} else {
$request = test_input($_POST["request"]);
$requestErr = "";
}
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
PHP Form Validation Example
";
echo $name . " / " . $nameErr;
echo "
";
echo $email. " / " . $emailErr ;
echo "
";
echo $company . " / " . $companyErr;
echo "
";
echo $request . " / " . $requestErr;
echo "
";
if ($name=="" and $email=="" and $company=="" and $request=="")
{
}else{
if ($nameErr=="" and $emailErr=="" and $companyErr=="" and $requestErr=="" )
{
// no error
echo "time to call send msg";
echo "
";
echo "PHPMailer called";
echo "
";
//function PHPMailer()
PHPMailer();
echo "int main: Name: ".$name;
echo "
";
// php_mail($name,$email,$company,$request);
echo "PHP mailer returned";
echo "
";
} else {
echo "
";
echo "MSG data is ERROR--please re-input";
echo "
";
}
}
}
?>
-->
end of code3