Jump to content

Flash phpmailer


billy nugz

Recommended Posts

Hey guys let me just stait that im a animator that dables with php.

I have a flash based form that I need to email with via smtp. I have read some of the phpmailer tutes on sorce fordge but this mail doesnt seem to be working. So I will post all my code and hope that one of you fine phpers can help.

First action script for send button.
[code]on (release) {

    if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
EmailProgress = "Please enter a valid E-mail address";
}

//else if (!ToEmail.length || ToEmail.indexOf("@") == -1 || ToEmail.indexOf(".") == -1) {
// EmailProgress = "Please enter a valid E-mail address that you are sending this to";
//}

//else if (!ToName.length) {
// EmailProgress = "Please Enter the name of who you are sending this to";
//}

else if (!names.length) {
EmailProgress = "Please Enter your name before Sending";
}

else if (!comments.length) {
EmailProgress = "Please enter some text in you message";
}

else {
loadVariablesNum ("email.php", "0", "Post");
//loadVariablesNum ("basic_mail.asp", "0", "Post");
//getURL ("ASPMail.asp", "", "Post");
       EmailProgress = "Thank you. Your message has been sent.";


}
}[/code]

Second the php code
[code]<?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
\***************************************************/
require("class.phpmailer.php");
$mail->IsSMTP();                                      // set mailer to use SMTP
$mail->Host = "smtp.email.ca";  // specify main and backup server
$mail->SMTPAuth = true;     // turn on SMTP authentication
//$mail->Username = "fake";  // SMTP username
//$mail->Password = "fake"; // SMTP password

$mail->From = "[email protected]";
$mail->FromName = "Mailer";

$mail->AddAddress("[email protected]");

$mail->Subject = "Mail Form";

// 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.


//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action != ""):
mail("$adminaddress","Info Request",
"A visitor has left the following information\n
First Name: $names
Email: $email
Company: $company
The visitor Wrote:
------------------------------
$comments

Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostfname: $ip
IP address: $REMOTE_ADDR
Date/Time:  $date","FROM:$adminaddress");

//This sends a confirmation to your visitor
mail("$email","Thank You for visiting $sitefname",
"Hi $fname,\n
Thank you for your interest in $sitefname\n
a member of,$sitefname will contact you shortly.
$sitefname
$siteaddress","FROM:$adminaddress");



endif;

?>
[/code]


Im very sure im doing things wrong but cant figure out how to do it right any hel would be great. OH ! if there is a easier sulution please let me know, Thanks for all and any help.
Link to comment
https://forums.phpfreaks.com/topic/34452-flash-phpmailer/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.