Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie php mail question.

Status
Not open for further replies.

kyre

Technical User
Dec 9, 2004
5
US
so I'm using flash which calls a php email form. I've used the form before and it works perfectly except now I'm trying it on a clients server (godaddy.com) and I just found out through tech support that godaddy doesn't support mail() . they say due to spammers? ok so is there another function to call instead of mail()?

this is the script I need to work.
<?php
$ToEmail = 'email@email.com';

$ToSubject = "subject line here";

$EmailBody = "SENT BY: $Name\n\nATTENDING?: $radio\n\nNUMBER OF PEOPLE: $NumberPeople\n";

mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$Name." <".$Email.">");

?>


and this is godaddy's php email code.
<?php
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET"){
$query_vars = $_GET;
} elseif ($request_method == "POST"){
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");
$fp = fopen("../data/gdform_$t","w");
while (list ($key, $val) = each ($query_vars)) {
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
fputs($fp,"$val\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
if ($key == "redirect") { $landing_page = $val;}
}
fclose($fp);
if ($landing_page != ""){
header("Location: ["HTTP_HOST"]."/$landing_page");
} else {
header("Location: ["HTTP_HOST"]."/");
}


?>



any help would be apprciated.
 
PHP provides one builtin function for sending mail, the eponymous mail() function.

That said, if you are allowed to do so by your sysadmins, it is possible to send email via PHP's socket function calls. Basically, do what the mail() function does, only using multiple function calls.

Before you even start with this, I recommend that you talk to your hosting provider. If they've shut off mail(), I'm thinking they'll have shut off PHP's socked functions, too.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
go daddy is no help at all. does anybody know how to encorporate go daddys work around (in first post above) to have the mail() work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top