Basically I created a contact form using php, GoDaddy marks most of them as spam, and the server does not even send the email.
So I tried making a smtp contact form and I'm running into some problems.
<?php
$recipients = "receiving email";
$from = "Support <support@domain.com>";
$to = "Accounts <accounts@domain.com>";
$subject = "Online Authorization Form";
$host = "smtpoutout.secureserver.net";
$port = "80";
$username = "email";
$password = "password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$name = $_POST['name'];
$address = $_POST['address'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$d = $_POST['d'];
$da = $_POST['da'];
$value = $_POST['chk'];
$pname = $_POST['pname'];
$title = $_POST['title'];
$agree = $_POST['agree'];
$employee = $_POST['employee'];
$formcontent=" From: $name \n Address: $address \n Email: $email \n Phone: $phone \n D: $d \n D Address: $da \n 'Client' has read Assignment and Contract Agreement: $value \n Print Name: $pname \n Title: $title \n I hear by agree that the information I have provided is true, accurate and the information I am submitting is not fraudulent. Please click the agree button that you adhere to Commercial Recovery Authority Inc.'s terms: $agree \n \n Employee ID: $employee \n IP: $ip";
mail = $smtp->send($to, $headers, $formcontent);
echo "Thank You!" . " -" . "<a href='index.php' style='text-decoration:none;color:#ffcb00;'> Return Home</a>";
?>
Getting an error on line 42,
Parse error: syntax error, unexpected '=' in /home/content/c/o/m/commercialrs/html/cra/mailtest.php on line 42
or
mail = $smtp->send($to, $headers, $formcontent);
So basically everything and anything could be wrong. Any suggestions or a better code for this?