les adjunto el codigo de cada uno de los archivos
contact.php
Código :
<?php //-----------------Getting data sent by flash--------------------- foreach ($_POST as $key => $value){ if ($key != 'mail_to' && $key != 'smtp_server' && $key != 'smtp_port' && $key != 'mail_from' && $key != 'mail_subject' && $key != 'plain_text'){ $mail_body .= '<b>'.str_replace('_',' ',$key).'</b>:<br/>'; $mail_body .= ''.stripslashes($value).'<br/>'; } } //----------------------------------------------------------------- $message = '<html><body>'.$mail_body.'</body></html>'; // mail body //------------if plain text is set to true removing html tags------ if ($_POST['plain_text']=='false') { $message = str_replace('<br/>',"\r\n", $message); $message = strip_tags($message); //------------------------------------------------------------------ } else { //----otherwise composing message headers--------------------------- $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //------------------------------------------------------------------ } //------------setting conf data------------------------------------- $to = $_POST['mail_to']; $from = $_POST['mail_from']; $subject = $_POST['mail_subject']; $smtp_server = $_POST['smtp_server']; $smtp_port = $_POST['smtp_port']; //------------------------------------------------------------------ //---------setting header info-------------------------------------- $headers .= 'A: '.$to. "\r\n"; $headers .= 'De: PortalWeb ' .$from. "\r\n"; //------------------------------------------------------------------ if (mail($to, $subject, $message, $headers)){ // sending mail print('&mail=1'); //succes } else { print('&mail=0');//failure } ?>
archivo configuracion xml
Código :
<?xml version="1.0" encoding="utf-8"?> <!-- Please read this information to learn how to set up the contact form integrated into the template. This readme file explains in details the meaning of the settings that can be done in the fcContactFormConfiguration.xml configuration file. It is recommended for you to use an XML editor to make changes to this file because it’s less possible to make an error in the markup which can cause to a not working contact form. --> <contactFormConfiguration> <emailTo>[email protected]</emailTo> <serverProcessorType>php</serverProcessorType> <serverProcessorFileName>contact</serverProcessorFileName> <validateRequiredOnly>false</validateRequiredOnly> <submitFormOnEnter>true</submitFormOnEnter> <messageSentText>Gracias por tu mensaje</messageSentText> <messageSentFailedText>Error al enviar mensaje</messageSentFailedText> <formProcessingText>procesando...</formProcessingText> <smtpServer>mail.sweetka.com</smtpServer> <smtpPort>25</smtpPort> <plainText>false</plainText> <emailFromSource>2</emailFromSource> <subjectSource>3</subjectSource> </contactFormConfiguration>
y el archivo de estructura xml
Código :
<?xml version="1.0" encoding="utf-8"?> <contactFormStructure> <formItems> <item id="1" label="Nombre" required="true"> <textToShow></textToShow> </item> <item id="2" label="E-mail" required="true"> <textToShow></textToShow> <validator>EmailValidator</validator> </item> <item id="3" label="Telefono" required="true"> <textToShow></textToShow> </item> <item id="4" label="Mensaje" required="true"> <textToShow></textToShow> </item> </formItems> </contactFormStructure>
y loas archivos xml se conectan con el flash con este codigo
Código :
onClipEvent (construct) { buttonsOutLabel = "out"; buttonsOverLabel = "over"; formConfigurationPath = "./estructuramail/form05configuration.xml"; formItemsPrefix = "tf_"; formStructurePath = "./estructuramail/form05structure.xml"; messageTextFieldPath = "cfMessage"; resetButtonPath = "bReset"; submitButtonPath = "bSubmit"; xmlFilesPrefix = ""; }
y en el servidor esta con la misma ruta. eso es todo la cidificacion gracias.