Forum Moderators: coopster
This has been lighting my hair on fire, I'm a real noob with php and despite my listed specialties above, I had to use flash for this project.
this little app in a nutshell is supposed to
1. let the user enter in their data
2. send a confirmation to the user in html, ugh :(
3. send a list of the variables to the boss (my client) again in html
and is composed of
1. a flash form
2. a small php script.
3. 2 html documents (boss_email.html & user_email.html)
i think that the problem is that the emails are sent from anonymous@cgi6.cgi6 and getting rejected. they work in yahoo mail, but not any other service. if it is of any use, the host is netfirms.
here is the php doc that accepts the variables from flash, it then sends the 2 html docs and switches out predefined strings with the variables
<?php$szFirstName = $_POST["firstName"];
$szLastName = $_POST["lastName"];
$szAddress = $_POST["address"];
$szCity = $_POST["city"];
$szState = $_POST["state"];
$szZip = $_POST["zip"];
$szEmail = $_POST["email"];
$szSponsor = $_POST["sponsor"];
$szAuth = $_POST["auth"];
$szDPhone = $_POST["dPhone"];
$szCPhone = $_POST["cPhone"];
$szIssue = $_POST["issue"];
// Set up the header information
$headers = "Content-Type: text/html; charset=\"us-ascii\"\r\n";
// Read and parse the user's email
$filearray = file("user_email.html");
while(list(,$line) = each($filearray))
{
$line = str_replace("FIRSTNAME", $szFirstName, $line);
$line = str_replace("LASTNAME", $szLastName, $line);
$line = str_replace("EMAIL", $szEmail, $line);
$line = str_replace("ADDRESS", $szAddress, $line);
$line = str_replace("CITY", $szCity, $line);
$line = str_replace("STATE", $szState, $line);
$line = str_replace("ZIPCODE", $szZip, $line);
$line = str_replace("D_PHN", $szDPhone, $line);
$line = str_replace("C_PHN", $szCPhone, $line);
$line = str_replace("ISSUE", $szIssue, $line);
$line = str_replace("SPONSOR", $szSponsor, $line);
$line = str_replace("AUTH", $szAuth, $line);
$user_email .= $line;
}
// Read and parse the boss's email
$filearray = file("boss_email.html");
while(list(,$line) = each($filearray))
{
$line = str_replace("FIRSTNAME", $szFirstName, $line);
$line = str_replace("LASTNAME", $szLastName, $line);
$line = str_replace("EMAIL", $szEmail, $line);
$line = str_replace("ADDRESS", $szAddress, $line);
$line = str_replace("CITY", $szCity, $line);
$line = str_replace("STATE", $szState, $line);
$line = str_replace("ZIPCODE", $szZip, $line);
$line = str_replace("SPONSOR", $szSponsor, $line);
$line = str_replace("AUTH", $szAuth, $line);
$line = str_replace("D_PHN", $szDPhone, $line);
$line = str_replace("C_PHN", $szCPhone, $line);
$line = str_replace("ISSUE", $szIssue, $line);
$boss_email .= $line;
}
// Send the user's email
$subject = "user confirm";
mail($szEmail, $subject, $user_email, $headers);
// Send the boss's email
$sendTo = "bossmail@example.com";
$subject = "boss confirm" . " " . $szFirstName . " " . $szLastName;
mail($sendTo, $subject, $boss_email, $headers);
?>
i know this isn't the optimal way to do this, but i have no perl fu. how do i adjust who the sender in this script so that it won't come from that sketchy address and get rejected? i just need a static sender like system@example2.com
please assume the utmost noobitity of me with your answers.
[edited by: eelixduppy at 10:57 am (utc) on April 12, 2007]
[edit reason] use example.com [/edit]