View Full Version : another amatuer with php... its the mailer again...
safaribob
07-18-2003, 06:08 AM
Hey all,
im having problems with the mailer just like a lot of other people ive seen here......
but i havent found a solution to my problem...
The mailer works, in a sense that i receive an email... however i cannot reply to the email, or get any idea of the email address of the person who sends the mail.
in my received mail, the from box contains "nobody", the subject contains the variable that i put in for name, and the other two variables seem to work ok....
The return email address comes up as "nobody@noreply.linuxengine.net"
all ive done is tried to manipluate jesse's mailer and this is what i came up with:
<?php
mail("jayhimself@tpg.com.au", $name, $message, $pet, "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/" . phpversion());
?>
any solutions?
CyanBlue
07-18-2003, 06:37 AM
Howdy... ;)
Are you saying that the PHP code automatically set it to "nobody@noreply.linuxengine.net" no matter what the user enters???
Can you copy and paste the mail header here???
Can you also show us the ActionScript that calls the PHP script???
;)
safaribob
07-19-2003, 07:15 AM
yeah thats what happens
From: "Nobody" <nobody@noreply.linuxengine.net>
To: <jayhimself@tpg.com.au>
Sent: Friday, July 18, 2003 4:18 PM
Subject: jay
> bill
>
> aslfh
-->where jay was the name i entered, bill and aslfh were just the other fields....
on (release) {
if (name eq "" or message eq "" or pet eq "" or from eq "") {
stop();
} else {
lineAdapt();
loadVariablesNum("mail.php3", 0, "POST");
gotoAndplay(391);
}
}
-->is the actionscript...
stop();
function lineAdapt() {
message_send = message;
while (msg_count<length(message)) {
msg_count = msg_count+1;
if ((substring(message_send, msg_count, 2)) eq "\r") {
message_send = (substring(message_send, 1, msg_count-2)) add "\n" add (substring(message_send, msg_count+2, (length(message_send))-msg_count+2));
}
}
message = message_send;
delete msg_count;
delete message_send;
}
-->is the keyframe script
cheers...
jay
CyanBlue
07-19-2003, 07:23 AM
Well... I don't see anything that goes with "nobody@noreply.linuxengine.net" at all in your code...
What is the answer for this question???Are you saying that the PHP code automatically set it to "nobody@noreply.linuxengine.net" no matter what the user enters???Some sample would help me to see the problem better...
And see this thread as well...
http://www.actionscript.org/forums/showthread.php3?s=&threadid=27589
safaribob
07-19-2003, 09:44 AM
yeah thats exactly what im saying... no matter what email address i enter, it always returns nobody@noreply.linuxengine.net
.... i may have to try something else otherwise...
cheers
jay
CyanBlue
07-19-2003, 10:06 AM
Hm... Is that the address that you have specified in the PHP.ini file by any chance???
Show me some sample or code or whatever that can help me understand your problem better... ;)
safaribob
07-19-2003, 10:15 AM
ok.... im not very experienced with php... actually i pretty much know nothing about it....
so the php.ini file will be where? and what scripting do you want me to give you an example of?
sorry about my incompetence, but thanks for helping!
CyanBlue
07-19-2003, 10:20 AM
Well... I don't know what your working environment is, but I am on W2K and my PHP.ini file is located in my Windows directory... It should be the same if you are locally working on the Windows based computer...
What about some screenshot of the form with user input filled out???
safaribob
07-19-2003, 10:29 AM
umm will it help if i just give you the address of the website?
www.connollyvet.com.au
newsletter section
cheers....
CyanBlue
07-19-2003, 10:43 AM
Yeah... Much better... ;)
So, if I input like...Name : My Name
Address : My Address
Pet's Name : My Pet
Email : email@myEmail.comand press 'Go', then you get to get something like this???
From: "Nobody" <nobody@noreply.linuxengine.net>
To: <jayhimself@tpg.com.au>
Sent: Friday, July 18, 2003 4:18 PM
Subject: My NameWell... I am not sure... Can you create a php file, phpinfo.php3, like this<?php
phpinfo();
?>and upload it to the same directory as your mail.php3 file on the server???
safaribob
07-19-2003, 10:49 AM
i did it, i still get the same result....
jay
CyanBlue
07-19-2003, 10:51 AM
Um... Did you create the file and upload it???
I tried http://www.connollyvet.com.au/phpinfo.php3 and I don't see the file running??? :confused:
safaribob
07-19-2003, 10:56 AM
oops... im sure i did .... but i obviously didnt....
its up now ... and i got the same result
CyanBlue
07-19-2003, 11:00 AM
No... I just asked you to create the file so that I could see if there is any strange thing set up in there, and I didn't find any...
Well... I do not know... The only thing I can do is to check the sample if you can create one... I'll have to go out for a while and will check this thread back later when I come back... ;)
safaribob
07-19-2003, 11:05 AM
yeah i just realised... as i said.. i dont know much about php...
thanks for your help.....
what sort of sample do u want?
CyanBlue
07-19-2003, 11:17 AM
Just form part from the newsletter section... That's the place where the problem is, right??? ;)
What is the version of Flash you are using??? Is it F5 or FMX???
I'll check back when I come back... ;)
safaribob
07-19-2003, 11:47 AM
i use flash mx....
ive uploaded the newsletter as an fla file... newsletter.fla onto www.connollyvet.com.au
its only 32kb
hopefully you will be able to see where i have gone wrong.
thanks heaps for your help
jay
safaribob
07-19-2003, 11:48 AM
www.connollyvet.com.au/newsletter.fla will get u there
freddycodes
07-19-2003, 04:18 PM
The problem is in the PHP script. You have one more parameter than mail() takes. So the last parameter which is supposed to be the message headers is not included and instead $pet is sent as the message headers, which also accounts for what the $name variable is showing up as the subject.
The mail parameter takes 4 params
mail(to, subject, message, headers);
You have
<?php
mail("jayhimself@tpg.com.au", $name, $message, $pet, "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/" . phpversion());
?>
So what did you want the subject to be, and are $message and $pet and $name all supposed to be in the body of the email, if so you would need to make one variable for the message body like
<?php
$body = "";
$body .= "Name: $name\n";
$body .= "Message: $message\n";
$body .= "Pet: $pet\n";
mail("jayhimself@tpg.com.au", "Form Submission", $body, "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/" . phpversion());
?>
CyanBlue
07-19-2003, 05:23 PM
Yeah... What freddycodes says... I should have gotten that one in the first place, but no sleep makes me stupid... :(
At the moment, safaribob has register_globals set to ON so, the code should be fine, but I think this should be more general in case register_globals is set to OFF...<?php
$email = "jayhimself@tpg.com.au";
$name = $_POST['name'];
$message = $_POST['message'];
$pet = $_POST['pet'];
$from = $_POST['from'];
$headers = "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/\nMIME-Version: 1.0\nContent-type: text/html; charset=iso-8859-1";
$message.= "<BR>Pet Name : $pet";
mail($email, $name, $message, $headers);
?>
freddycodes
07-19-2003, 05:48 PM
Sure steal the thunder :D
I like your modifications, showing promising signs young grasshopper, I think you are learning just how bad globals are ;)
CyanBlue
07-19-2003, 05:53 PM
I have a great teacher... Don't you realize that??? :D
safaribob
07-19-2003, 11:39 PM
thanks guys it works now!
im really grateful...
thanks for helping me out!
cheers jay
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.