PDA

View Full Version : Check this code please...


globalwin
08-01-2002, 12:35 PM
Can some one please look at this code because it doesnt send two emails :(


<?
$email = "First Name:\t$FirstName\nLast Name:\t$LastName\nE-mail Address:\t$Email\nDomain:\t$Domain\nBilling/Mailing Address:\t$Address\n\nIP:\t$REMOTE_ADDR\nBrowser:\ t$HTTP_USER_AGENT\n\n";
$to = "orders@mydomain.com";
$subject = "Someone Ordered A Domain Name";
$mailheaders = "From: $FirstName $LastName <> \n";
$mailheaders .= "Reply-To: $email\n\n";

$email1 = "First Name:\t$FirstName\nLast Name:\t$LastName\nE-mail Address:\t$Email\nDomain:\t$Domain\nBilling/Mailing Address:\t$Address\n\nIP:\t$REMOTE_ADDR\nBrowser:\ t$HTTP_USER_AGENT\n\n";
$to1 = "$Email";
$subject1 = "You Ordered A Domain Name";
$mailheaders1 = "From: L33Thost Billing <> \n";
$mailheaders1 .= "someone@someone.com\n\n";

mail($to, $subject, $email, $mailheaders);
mail($to1, $subject1, $email1, $mailheaders1);
?>

tHE DSS
08-07-2002, 11:29 PM
.... ahhh... ignore me... sorry... i'm half.... no... i'm very asleep.

tHE DSS
08-07-2002, 11:39 PM
Okay.. the previous post edited. :(

Aiii... what if you get rid of the quote marks from :

$to1 = "$Email";

... if no luck... then try echoing out $Email, and check you don't have any weird characters, perhaps either side of the string.

To top, you should really be checking mail values.... here, you can have my little routine :


if(strstr($emailAddress,'@') && strstr($emailAddress,'.')) {
if ($emaildomain=substr(strstr($emailAddress,"@"),1)) {
$tmp = getmxrr($emaildomain, $mxs);
if (!$mxs[0]) {
// mail domain doesn't exist... so output error here
} else {
// domain exists... you can accept the address
}
} else {
// the supplied address is invalid...
// ie, it doesn't contain a @ (at symbol) or a . (full stop)
}


... if i'm too late, or have been no help, then forgive.... i'm just mental. :confused: :p