I have one of those dreaded TM templates which looks great, but the ‘contact’ part of the website does not work. Their tech support is frankly, pants. I can fill out the 4 fields and it recognises the data and will give a correct ‘message sent / message failed’ result but the data is never recieved in my inbox.
I have confirmed my server is php valid as I’ve done a simple test php.
I think the problem lies with the first few lines of code where the data is captured by the ‘contact.php’ script.
the 'Contact.php :
[php]
'; $mail_body .= ''.stripslashes($value).'
'; }} //----------------------------------------------------------------- $message = ''.$mail_body.''; // mail body //------------if plain text is set to true removing html tags------ if ($_POST['plain_text']=='true') { $message = str_replace('
',"\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------------------------------[code][/code]-------- $headers .= 'To: '.$to. "\r\n"; $headers .= 'From: Site visitor ' .$from. "\r\n"; //------------------------------------------------------------------ if (mail ($to, $subject, $message, $headers)) { // sending mail print('&mail=1'); //succes } else { print('&mail=0');//failure } ?>[/php]
The config file:
[code]<?xml version="1.0" encoding="utf-8"?>
[email protected] php contact true false Message sent. Message failed.....Please re-enter your details or send an email. processing... localhost 25 false 2 WebsiteVisitor <!-- Validation error messages that are showing to the user when the form fails to validate. The form supports different types of validators. You can change the text of the error messages the validators produce here. You can use the {LABEL} keyword in these messages. It will replace it with the
label value of the field where an error occurs.
-->
<validationErrorMessages>
<!--
A required field is not filled in.
-->
<message type="fieldIsRequired">{LABEL} is required.</message>
<!--
The specified e-mail address is incorrect.
-->
<message type="emailNotValid">{LABEL} - is not valid email address.</message>
<!--
The specified number of characters in a field is less than a required minimum.
-->
<message type="minCharsLimitError">{LABEL} - The specified number of characters in a field is less than a required minimum.</message>
<!--
The specified string does not match with the regular expression.
-->
<message type="reqExpError">{LABEL} - The specified string does not match with the regular expression.</message>
<!--
The specified number is greater than an acceptable biggest number for this field.
-->
<message type="biggerThanMaxError">{LABEL} - The specified number is greater than an acceptable biggest number for this field.</message>
<!--
The specified number is lower than an acceptable lowest number for this field.
-->
<message type="lowerThanMinError">{LABEL} - The specified number is lower than an acceptable lowest number for this field.</message>
<!--
The data is not a number.
-->
<message type="notANumberError">{LABEL} - The data is not a number.</message>
<!--
The specified number must not be negative.
-->
<message type="negativeError">{LABEL} - The specified number must not be negative.</message>
<!--
The minimum number of variants is not selected
-->
<message type="minRequirementError">{LABEL} - The minimum number of variants is not selected</message>
<!--
The number of variants selected exceeds the maximum
-->
<message type="maxRequirementError">{LABEL} - The number of variants selected exceeds the maximum</message>
<!--
The fields that should be equal do not match
-->
<message type="shouldBeEqualError">{LABEL} - values do not match</message>
<!--
The date has wrong format.
-->
<message type="dateIsNotValidError">{LABEL} - date has wrong format</message>
</validationErrorMessages>
[/code]
and the structure file:
[code]<?xml version="1.0" encoding="utf-8"?>
<formItems>
<item id="1" label="Name" required="true">
<textToShow>NAME:</textToShow>
</item>
<item id="3" label="Tel">
<textToShow>PHONE:</textToShow>
<restrict>+-.0-9</restrict>
</item>
<item id="2" label="E-mail" required="true">
<textToShow>E-MAIL:</textToShow>
<validator>EmailValidator</validator>
</item>
<item id="4" label="Message" required="true">
<textToShow>MESSAGE:</textToShow>
</item>
</formItems>
[/code]