PDA

View Full Version : PHP Mailing question


pdarley
08-24-2005, 05:16 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:

<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<?php

$myemail = "[email protected]";
$ccx = "[email protected]";
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 ?>


THanks,
Pres

Paul Ferrie
09-05-2005, 09:10 AM
Have i got this right?
the form itself would be onwww. domain1.com
Form submit would be on www.domain2.com/php/mailer.php

?