PHP Mailing Question
Posted: Wed Aug 24, 2005 12:31 pm
I have this script that will mail from where it is currently being hosted. But, if I wanted to have this script mail from an external host, how would I go about doing that? Can anyone offer some advice to this PHP newb.
Here is my code:
Thanks in advance,
Preston
Here is my code:
Code: Select all
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<?php
$myemail = "myemail@domain.com";
$ccx = "ccemail@domain.com";
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use the back button - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitor) || empty($visitormail)) {
echo "<h2>Use the back button - fill in all fields</h2>\n";
}
echo $badinput;
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
";
$from = "From: $visitor\r\n";
if (($visitormail != ""))
mail($visitormail, $subject, $message, $from);
if ($myemail != "")
mail($myemail, $subject, $message, $from);
if ($ccx != "")
mail($ccx, $subject, $message, $from);
?>
<?php echo $ip ?>Preston