# Mailing problems with php! PLZ HELP!

**URL:** https://forum.kirupa.com/t/mailing-problems-with-php-plz-help/199796
**Category:** Uncategorized
**Created:** [September 6, 2006, 6:14am UTC](https://forum.kirupa.com/t/mailing-problems-with-php-plz-help/199796 "2006-09-06T06:14:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![scafusia](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@scafusia](https://forum.kirupa.com/u/scafusia)
#### Post date: [September 6, 2006, 6:14am UTC](https://forum.kirupa.com/t/mailing-problems-with-php-plz-help/199796/1 "2006-09-06T06:14:25Z")

</div>

Hi folks!  
I try to send an email from flash wit php. The problem is that I have a main movie which loads external swf files. One of them is my contact swf too. And when this is loaded and I fill the contact sheet doesn´t wants to send the email. If I upload only the contact file with published in flash works fine. So finaly I think that what is wrong is that the external contact swf is loaded isn´t on the root. I must change some scripts but I dunno yet what becuse I tried a lot os change but becuse I´m a very newby dont works.  
I write the scipt from the fla. and the php file .  
If someone can help me I´ll be should be very lucky

so the php file is the following:  
\<?

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\*\*  
\*\* PHP Mailer 2.0  
\*\*  
\*\* This script is easy to configure. Just change the variables below to  
\*\* suit your environment and PHP does the rest!  
\*\*  
\*\* [[COLOR=#800080]http://www.bigjolt.com[/COLOR]](http://www.bigjolt.com/)  
\*\*  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

Enter your site details below!

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

// Enter your contact email address here  
$adminaddress = "bigjolt@bigjolt.com";

// Enter the address of your website here include [[COLOR=#0000ff]http://www.[/COLOR]](http://www./)  
$siteaddress =“[http://www.your.site](http://www.your.site)”;

// Enter your company name or site name here  
$sitename = “Your Site Name”;

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

No need to change anything below …

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

// Gets the date and time from your server  
$date = date(“m/d/Y H:i:s” ![](http://www.were-here.com/forum/smilies/wink.gif) ;

// Gets the IP Address  
if ($REMOTE\_ADDR == “” ![](http://www.were-here.com/forum/smilies/wink.gif) $ip = “no ip”;  
else $ip = getHostByAddr($REMOTE\_ADDR);

//Process the form data!  
// and send the information collected in the Flash form to Your nominated email address  
if ($action != “” ![](http://www.were-here.com/forum/smilies/wink.gif) :  
mail("$adminaddress",“Info Request”,  
"A visitor at $sitename has left the following information

First Name: $fname  
Last Name: $lname  
Email: $email  
Company: $cname  
Telephone: $telno

## The visitor commented:

$comments

## Logged Info :

Using: $HTTP\_USER\_AGENT  
Hostname: $ip  
IP address: $REMOTE\_ADDR  
Date/Time: $date",“FROM:$adminaddress” ![](http://www.were-here.com/forum/smilies/wink.gif) ;

//This sends a confirmation to your visitor  
mail("$email",“Thank You for visiting $sitename”,  
"Hi $fname,

Thank you for your interest in $sitename!

Cheers,  
$sitename  
$siteaddress",“FROM:$adminaddress” ![](http://www.were-here.com/forum/smilies/wink.gif) ;

//Confirmation is sent back to the Flash form that the process is complete  
$sendresult = "Thank you for visiting \<a href = “$siteaddress” target = “\_blank”\>\<u\>$sitename\</u\>\</a\>. You will receive a confirmation email shortly. ";  
$send\_answer = “answer=”;  
$send\_answer .= rawurlencode($sendresult);  
echo “$send\_answer”;

endif;

?\>

The Action Script is the following from frame 1;  
scommand (“allowscale”, “false” ![](http://www.were-here.com/forum/smilies/wink.gif) ;  
//  
// set some variables  
//  
mailform = “mailform.php”;  
confirm = “please wait for confirmation …”  
action = “send”;  
//  
// and focus on variable fname  
//  
Selection.setFocus(“fname” ![](http://www.were-here.com/forum/smilies/wink.gif) ;  
//  
// validate email function  
//  
function validate (address) {  
if (address.length\>=7) {  
if (address.indexOf("@" ![](http://www.were-here.com/forum/smilies/wink.gif) \>0) {  
if ((address.indexOf("@" ![](http://www.were-here.com/forum/smilies/wink.gif) +2)\<address.lastIndexOf("." ![](http://www.were-here.com/forum/smilies/wink.gif) ) {  
if (address.lastIndexOf("." ![](http://www.were-here.com/forum/smilies/wink.gif) \<(address.length-2)) {  
return (true);  
}  
}  
}  
}  
return (false);  
}  
//  
//form check  
//  
function formcheck () {  
if ((((email == null)) || (email.length\<1)) || (email == “ERROR! Address not valid” ![](http://www.were-here.com/forum/smilies/wink.gif) ) {  
email = “ERROR! Address not valid”;  
action = “”;  
}  
if (!validate(email)) {  
email = “ERROR! Address not valid”;  
action = “”;  
}  
if (fname == null) {  
fname = “ERROR! Name required”;  
action = “”;  
}  
if (lname == null) {  
lname = “ERROR! Name required”;  
action = “”;  
}  
if ((validate(email)) && (email != “ERROR!” ![](http://www.were-here.com/forum/smilies/wink.gif) && (fname != “” ![](http://www.were-here.com/forum/smilies/wink.gif) && (lname != “” ![](http://www.were-here.com/forum/smilies/wink.gif) ) {  
action = “send”;  
loadVariablesNum (mailform, 0, “POST” ![](http://www.were-here.com/forum/smilies/wink.gif) ;  
gotoAndPlay (“wait” ![](http://www.were-here.com/forum/smilies/wink.gif) ;  
}  
}  
stop ();

and from frame 5:  
loadVariablesNum(mailform, 0);  
answer = confirm;

or You can find it here too  
[[COLOR=#800080]http://www.flashkit.com/movies/Utilities/Other/PHP\_Mail-henry-4983/index.php[/COLOR]](http://www.flashkit.com/movies/Utilities/Other/PHP_Mail-henry-4983/index.php)  
Thx for reading  
Cheers SCAFUSIA  
NoImage = NoSigImageNoImage = NoImageRes
