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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple e-mail form not sending mail (some flash) 1

Status
Not open for further replies.

krigbert

Programmer
Jun 2, 2005
95
0
0
NO
It's been a good while since I did any web programming of any kind, since I've decided to focus more on just design and illustration – but apparently an old bug has shown up, and I don't really know what to do.

It's a flash page that has a simple mail form, this is the essence of the code in flash:

Code:
on (release) {
    navn=navn.split(" ").join("_")
    lineAdapt();
    loadVariablesNum("mail.php", 0, "POST");
}

Code:
toAddy='info@site.bla';
subject="";
message="";

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;
}

And here's the essence of mail.php

Code:
$subjec =  $subject;

//$subjec = mb_convert_encoding($subject, "ISO-8859-1", "UTF-8");

$messa = '
<html>
<body style="font-family:Verdana, sans-serif; background-color:#FFFFFF; height: 100%; width: 100%;">
<p>';

$messa .= $message;


$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";

$headers .= "From: ";

$headers .= $navn;

$headers .= " <";

$headers .= $from;

$headers .= ">" . "\r\n";

mail($toAddy , $subjec, $messa, $headers);

Now, when I click send in the website, nothing gets sent, and I'm just not sure how I'd go about troubleshooting this. I've tested to see if the mail() function works, and it does – so I guess something must be wrong with my code.

illustration and graphic design
 
How exactly are you getting the contents of the form from the flash form to the PHP script?

In other words where exactly are variables like $subject getting set?

2. What are your mail settings for the server this is on?

Is there a valid SMTP server configured for the mail function?

Additionally, make sure that display_errors is set to "on"
and error_reporting is set to E_ALL for your PHP configuration so that if something is going wrong it will display relevant errors. And make it easier to debug.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks a lot, for some reason I hadn't thought to test the php file on it's own – seems the problem is indeed that the variables aren't passed properly on from flash :)

illustration and graphic design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top