Page 2 of 3
Posted: Sat Mar 19, 2005 6:29 pm
by John Cartwright
It is a very simple process.
if nothing is returned by print_r($_POST); then your $_POST variables are sent.
Are you sending the URL through the URL or a form?
--> if you are using the URL .. change $_POST to $_GET
Posted: Sat Mar 19, 2005 6:29 pm
by forzato
Hawleyjr;
"The only 'intutive' interface is the nipple. After that, it's all learned." -Bruce Ediger
That's pretty funny!
(and true)
Posted: Sat Mar 19, 2005 6:33 pm
by forzato
Hawleyjr;
Indeed this is one of those scripts you mentioned - and it works well. That is until I try to tweek it to use a dynamic email address via the variable "email" (vs the static email like
email@snet.net)
Phenom;
I think it's sent via a form, but how would I know for sure?
Posted: Sat Mar 19, 2005 6:35 pm
by forzato
PS : the flash swf file is not set up to receive anything from the php server side script... the flash swf just sends the variable "email" to this php script... then the php sends an email out
Posted: Sat Mar 19, 2005 6:36 pm
by hawleyjr
replace the $_POST WITH $_GET
Code: Select all
echo '<HR><PRE>'; print_r($_GET); echo '</PRE>';
Posted: Sat Mar 19, 2005 6:37 pm
by forzato
Phenom;
Upon further reflection of your last post (POST vs GET) indeed this is sent via a form rather than a url...
Any thoughts?
Posted: Sat Mar 19, 2005 6:40 pm
by John Cartwright
as I said before,
if
print_r($_POST);
returns nothing then your form was not submitted.
Posted: Sat Mar 19, 2005 6:59 pm
by forzato
I'd never thought I'd live to say this but...
Further testing has revealed a flaw in my statement.
The problem appears to be one of domains - ie the server side php script below works ONLY if the variable "email" is an email in the same domain as the flash swf and server... is there a fix?
Code: Select all
<?php
$sendTo = $_POST["email"];
$subject = "*** instant email response ***";
$headers = "From: " . $_POST["email"] ." "."<" . $_POST["email"] .">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-path: " . $_POST["email"];
$message = $_POST["name"] ." (name) ". $_POST["email"] ." (email) ";
mail($sendTo, $subject, $message, $headers);
?>
feyd | Please review how to post code using Code: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Posted: Sat Mar 19, 2005 7:40 pm
by forzato
hawleyjr wrote:To Phenom's point about being the same to and from email address. some servers won't let email in that has the same domain name as the server domain name.
I'm sure this is the problem... is there a trick ??? (...set the right return path?)
Posted: Sat Mar 19, 2005 7:51 pm
by hawleyjr
change the send from in the headers.
Posted: Sat Mar 19, 2005 8:13 pm
by forzato
hawleyjr wrote:change the send from in the headers.
Thanks for the reply... could you elaborate a bit?
Posted: Sat Mar 19, 2005 8:14 pm
by forzato
Code: Select all
<?php
/***************************************************\
* PHP 4.1.0+ version of email script. For more
* information on the mail() function for PHP, see
* http://www.php.net/manual/en/function.mail.php
\***************************************************/
// First, set up some variables to serve you in
// getting an email. This includes the email this is
// sent to (yours) and what the subject of this email
// should be. It's a good idea to choose your own
// subject instead of allowing the user to. This will
// help prevent spam filters from snatching this email
// out from under your nose when something unusual is put.
$sendTo = $_POST["email"];
$subject = "*** PASSWORD request ***";
// variables are sent to this PHP page through
// the POST method. $_POST is a global associative array
// of variables passed through this method. From that, we
// can get the values sent to this page from Flash and
// assign them to appropriate variables which can be used
// in the PHP mail() function.
// header information not including sendTo and Subject
// these all go in one variable. First, include From:
$headers = "From: CustomerService@CorporateCarPricing.com" . ">\r\n";
// next include a replyto
$headers .= "Reply-To: CustomerService@CorporateCarPricing.com" . "\r\n";
// often email servers won't allow emails to be sent to
// domains other than their own. The return path here will
// often lift that restriction so, for instance, you could send
// email to a hotmail account. (hosting provider settings may vary)
// technically bounced email is supposed to go to the return-path email
$headers .= "Return-path: CustomerService@CorporateCarPricing.com" . "\r\n";
// now we can add the content of the message to a body variable
$message = "Congratulations ". $_POST["name"] . "! Pending final CCP Membership confirmation, here is your Corporate Car Pricing user ID and password: ". $_POST["temppassword"];
// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $message, $headers);
?>
Posted: Sat Mar 19, 2005 8:25 pm
by hawleyjr
Is the email address your trying to send to @CorporateCarPricing.com??
if so, try to send it to a hotmail or yahoo account to see if it works there.
Posted: Sat Mar 19, 2005 8:29 pm
by forzato
hawleyjr wrote:Is the email address your trying to send to @CorporateCarPricing.com??
if so, try to send it to a hotmail or yahoo account to see if it works there.
Actually I'm trying to send to the email address specified in the variable 'email'
Thanks again for your help!
PS script will send email if the 'email' variable is an address in the CorporateCarPricing.com domain - otherwise no go.
Posted: Sat Mar 19, 2005 9:04 pm
by feyd
sounds like either the email server on the domain denies all external addresses, or the external addresses deny the email. Either can be the case.