View Full Version : Trouble with email script

08-01-2012, 03:40 AM
I have a flash file that supplies fields to a PHP script that emails
Everything works OK
But... when I try sending to a second email address, it *just* doesn't work!

The first email is sent like this:


I follow this up immediately by doing this:


The second email just doesn't get sent!!
I'm pulling my hair out - I've spent 2.5 hours on the damn problem!!

I'm attaching the actual script to this post (I've made into a txt file, the forum won't allow me to upload a PHP file)
(Actual email addresses and other names have been replaced with dummy ones)

ALSO... if there's a better script than this one to send email, I'd appreciate if someone could give a link to

ALSO... I have this:


echo "result=$ok";

The second line send a message back to the Flash file saying that the email has been successfully sent
Does this look OK?

Any help or pointers would be really appreciated

EDIT: i forgot to add, i must have the second email sent as a new email
it's a long story - the recipients email will only receive if they are emailed directly with no other email addresses being sent to in the same email



08-01-2012, 04:51 AM
You're experiencing a timing problem.

Try this ...

// sent

// sent

What that does is, the script must finish the mail function in order to
determine the "if" statement to be True or False. That forces it to
complete the function before moving on. It will do that for both functions.

See if that fixes your problem.