Jump to content

pear mail going to spam


dsjoes

Recommended Posts

The script below works but it goes straight to the junk folder only since i added the parts below to the form. (the form is in another file)

How do i stop it from going to the junk folder.

 

$error = $_GET['error'];

$httpagent = getenv ('HTTP_USER_AGENT');

$url = $_SERVER['HTTP_REFERER'];

 

<?php
require_once "Mail.php";
	$optional = $_POST['optional'];
$error = $_POST['error'];
$url = $_POST['url'];
$httpagent = $_POST['browser'];
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';

$from = "Web server <removed>";
$to = "Admin <removed>";
$subject = "Someone has submitted an error.";
$body = "Someone has submitted an error.\n".
	"Error: $error\n".
	"URL: $url\n".
	"Web browser: $httpagent\n".
	"Anything else you want to add?: $optional\n".
	"IP: $ip\n";

$host = "removed";
$username = "removed";
$password = "removed";

$headers = array ('From' => $from,
   'To' => $to,
   'Subject' => $subject);
$smtp = Mail::factory('smtp',
   array ('host' => $host,
     'auth' => true,
     'username' => $username,
     'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
   echo("<p>" . $mail->getMessage() . "</p>");
  } else {
   header('Location: thank-you.html');
  }
?>

Link to comment
https://forums.phpfreaks.com/topic/231691-pear-mail-going-to-spam/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.