Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP mail form

Status
Not open for further replies.

catalystcommercial

Technical User
Oct 6, 2005
53
GB
Hi there

I have created a form in html and a script in php

When I submit the form it direct to the php page and displays a message as follows " Your data has been recorded successfully!"

However no emails are sent to my account, can someone please advise me

here are the codes:

HTML:
<html xmlns:fo="<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>GoldMine Import Template 1</title>
<style type="text/css"><!--.primary {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
background-color: #FFFFFF;
}
.style1 {
font-size: 14px;
font-weight: bold;
color: #3366CC;
background-color: #FFFFFF;
}
.required {
color: #FF0000;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}
.input_glow {
font-family: Arial, "Courier New", Courier, mono;
font-size: 12px;
background-color: #FFFF99;
}
.input_standard {
font-family: Arial, "Courier New", Courier, mono;
font-size: 12px;
background-color: #FFFFFF;
}
.style2 {
font-size: 12px;
color: #000000;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
-->
</style><script language="JavaScript" type="text/JavaScript">
<!--
document.MM_returnValue=true;document.MyErrors='';
function MM_findObj(n, d) {var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);if(!x && d.getElementById) x=d.getElementById(n); return x;}
function MM_validateForm() {var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);if (val) { nm=val.name;pnm='pretty_'+nm;po=MM_findObj(pnm);if(po){ponm=po.value;}else{ponm=nm;}if ((val=val.value)!="") {if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');if (p<1 || p==(val.length-1)) {if (errors.indexOf('must contain an e-mail')==-1){errors+='- '+ponm+' must contain an e-mail address.\n';}}} else if (test!='R') { num = parseFloat(val);if (isNaN(val)) errors+='- '+ponm+' must contain a number.\n';if (test.indexOf('inRange') != -1) { p=test.indexOf(':');min=test.substring(8,p); max=test.substring(p+1);if (num<min || max<num) errors+='- '+ponm+' must contain a number between '+min+' and '+max+'.\n';} } } else if (test.charAt(0) == 'R') errors += '- '+ponm+' is required.\n'; }} if (errors){document.MyErrors +=errors;document.MM_returnValue=false;}}
function ShowErrors(){if (document.MyErrors!=''){alert('The following error(s) occurred:\n'+document.MyErrors);}}
-->
</script></head>
<body class="primary">
<table width="100%">
<form method="POST" name="frmGMGenerated" target="_self" id="frmGMGenerated" action="<tr>
<td width="99%">
<p>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="style1">Primary Information</td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">Full Name</td>
<td width="915"><input tabindex="2" type="text" id="CONTACT" name="CONTACT" size="40" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="40"></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">E-mail</td>
<td width="915"><input tabindex="8" type="text" id="EMAIL" name="EMAIL" size="40" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="35"></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">Phone Number</td>
<td nowrap="true" width="100">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="true" width="260"><input tabindex="9" type="text" id="PHONE1" name="PHONE1" size="30" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="25"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">Address1</td>
<td width="915"><input tabindex="18" type="text" id="ADDRESS1" name="ADDRESS1" size="60" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="40"></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">Address2</td>
<td width="915"><input tabindex="19" type="text" id="ADDRESS2" name="ADDRESS2" size="60" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="40"></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">Address3</td>
<td width="915"><input tabindex="20" type="text" id="ADDRESS3" name="ADDRESS3" size="60" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="40"></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">City</td>
<td nowrap><input tabindex="21" type="text" id="CITY" name="CITY" size="30" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="30"></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">County</td>
<td nowrap><!----><select tabindex="22" name="STATE" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'"><option selected value="">Select a State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">Dist. of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
<option></option>
<OPTION>U.S. Territories</OPTION>
<OPTION value="GU">Guam</OPTION>
<OPTION value="AS">American Samoa</OPTION>
<OPTION value="FM">Federated States of Micronesia</OPTION>
<OPTION value="MP">Northern Mariana Islands</OPTION>
<OPTION value="MH">Marshall Islands</OPTION>
<OPTION value="PW">Palau Islands</OPTION>
<OPTION value="PR">Puerto Rico</OPTION>
<OPTION value="VI">US Virgin Islands</OPTION>
<OPTION></OPTION>
<OPTION>Canadian Provinces</OPTION>
<OPTION value="AB">Alberta</OPTION>
<OPTION value="BC">British Columbia</OPTION>
<OPTION value="MB">Manitoba</OPTION>
<OPTION value="NB">New Brunswick</OPTION>
<OPTION value="NF">Newfoundland</OPTION>
<OPTION value="NT">Northwest Territories</OPTION>
<OPTION value="NS">Nova Scotia</OPTION>
<OPTION value="ON">Ontario</OPTION>
<OPTION value="PE">Prince Edward Island</OPTION>
<OPTION value="PQ">Quebec</OPTION>
<OPTION value="SK">Saskatchewan</OPTION>
<OPTION value="YT">Yukon Territory</OPTION>
<OPTION value="Other">Other or None</OPTION></select></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">Post Code</td>
<td nowrap><input tabindex="23" type="text" id="ZIP" name="ZIP" size="15" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="10"></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td nowrap="true" width="140" class="style2">Country</td>
<td width="915"><!----><select tabindex="24" name="COUNTRY" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'"><option selected value="">Select your country</option>
<option value="US">United States</option>
<option value="UK">United Kingdom</option>
<option value="DE">Germany</option>
<option value="CA">Canada</option>
<option value="JP">Japan</option>
<option value="CH">Switzerland</option>
<option value="FR">France</option>
<option value="NL">Netherlands</option>
<option value="IT">Italy</option>
<option value="ES">Spain</option>
<option>- - - - - - -</option>
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AO">Angola</option>
<option value="AR">Argentina</option>
<option value="AM">Armenia</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="AZ">Azerbaijan</option>
<option value="BH">Bahrain</option>
<option value="BD">Bangladesh</option>
<option value="BE">Belgium</option>
<option value="BZ">Belize</option>
<option value="BJ">Benin</option>
<option value="BO">Bolivia</option>
<option value="BA">Bosnia Hercegovina</option>
<option value="BW">Botswana</option>
<option value="BR">Brazil</option>
<option value="BG">Bulgaria</option>
<option value="BF">Burkina Faso</option>
<option value="BY">Byelorussia</option>
<option value="CM">Cameroon</option>
<option value="CA">Canada</option>
<option value="TD">Chad</option>
<option value="CL">Chile</option>
<option value="CN">China</option>
<option value="CO">Colombia</option>
<option value="CG">Congo</option>
<option value="HR">Croatia</option>
<option value="CY">Cyprus</option>
<option value="CZ">Czech Republic</option>
<option value="DK">Denmark</option>
<option value="DJ">Djibouti</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="EE">Estonia</option>
<option value="ET">Ethiopia</option>
<option value="FI">Finland</option>
<option value="FR">France</option>
<option value="GF">French Guiana</option>
<option value="GA">Gabon</option>
<option value="GM">Gambia</option>
<option value="GE">Georgia</option>
<option value="DE">Germany</option>
<option value="GH">Ghana</option>
<option value="GR">Greece</option>
<option value="GT">Guatemala</option>
<option value="GN">Guinea</option>
<option value="GW">Guinea-bissau</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="IN">India</option>
<option value="ID">Indonesia</option>
<option value="IR">Iran</option>
<option value="IQ">Iraq</option>
<option value="IE">Ireland</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="CI">Ivory Coast</option>
<option value="JP">Japan</option>
<option value="JO">Jordan</option>
<option value="KE">Kenya</option>
<option value="KW">Kuwait</option>
<option value="LV">Latvia</option>
<option value="LB">Lebanon</option>
<option value="LR">Liberia</option>
<option value="LY">Libya</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MG">Madagascar</option>
<option value="MW">Malawi</option>
<option value="MY">Malaysia</option>
<option value="ML">Mali</option>
<option value="MT">Malta</option>
<option value="MQ">Martinique</option>
<option value="MR">Mauritania</option>
<option value="Mexico">Mexico</option>
<option value="MD">Moldova Republic</option>
<option value="MA">Morocco</option>
<option value="MZ">Mozambique</option>
<option value="NA">Namibia</option>
<option value="NP">Nepal</option>
<option value="NL">Netherlands</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NE">Niger</option>
<option value="NG">Nigeria</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PK">Pakistan</option>
<option value="PA">Panama</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="QA">Qatar</option>
<option value="RO">Romania</option>
<option value="RU">Russia</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="SC">Seychelles</option>
<option value="SL">Sierra Leone</option>
<option value="SG">Singapore</option>
<option value="SI">Slovenia</option>
<option value="SO">Somalia</option>
<option value="ZA">South Africa</option>
<option value="KR">South Korea</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SD">Sudan</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="SY">Syria</option>
<option value="TW">Taiwan</option>
<option value="TJ">Tajikistan</option>
<option value="TZ">Tanzania</option>
<option value="TH">Thailand</option>
<option value="TG">Togo</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="TM">Turkmenistan</option>
<option value="UG">Uganda</option>
<option value="UA">Ukraine</option>
<option value="AE">United Arab Emirates</option>
<option value="UK">United Kingdom</option>
<option value="US">United States</option>
<option value="UY">Uruguay</option>
<option value="UZ">Uzbekistan</option>
<option value="VE">Venezuela</option>
<option value="VN">Viet Nam</option>
<option value="YU">Yugoslavia</option>
<option value="ZR">Zaire</option>
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
<option value="Other">Other Country</option></select></td>
</tr>
</table><br><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="style1">Secondary Information</td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td class="style2" nowrap="true" width="140">Partner Code</td>
<td width="915"><input type="text" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="20" id="KEY3" name="KEY3" tabIndex="26" size="30"></td>
</tr>
<tr>
<td nowrap="true" width="10">
</td>
<td class="style2" nowrap="true" width="140">Source Code</td>
<td width="915"><input type="text" class="input_standard" onFocus="javascript:className='input_glow'" onblur="javascript:className='input_standard'" maxlength="20" id="SOURCE" name="SOURCE" tabIndex="27" size="30"></td>
</tr>
</table><br><input type="hidden" name="SMTP" id="SMTP" value="192.168.0.77"><input type="hidden" name="SendToEmail" id="SendToEmail" value="goldform@catalyst-commercial.co.uk"><input type="hidden" name="DupLogic" id="DupLogic" value=""><input type="hidden" name="OnDupAttachTrack" id="OnDupAttachTrack" value=""><input type="hidden" name="OnNewAttachTrack" id="OnNewAttachTrack" value="722F04799926128693240774942F0D7F43230B62A03B1B878E2B1180A5380A6F"><input type="hidden" name="OnDUPSendGMEmail" id="OnDUPSendGMEmail" value="6D2A054D86341E678C39"><input type="hidden" name="OnNewSendGMEmail" id="OnNewSendGMEmail" value="78351D658E3C064F7C29"><input type="hidden" name="Word" id="Word" value=""><input type="hidden" name="DuplicateCount" id="DuplicateCount" value="0"><input type="hidden" name="OutPutAs" id="OutPutAs" value="XML"></td>
</tr>
<tr>
<td align="right" nowrap="true" width="560"><input tabindex="99" type="Reset" id="Reset" name="Reset" value="Reset form"><font color="FFFFFF">x</font><input tabindex="100" type="submit" id="GMsubmit" name="GMsubmit" value="Submit form"></td>
<td>
</td>
</tr>
</form>
</table>
</body>
</html>


PHP Code:
<html>
<head>
<title>PHP Mail from GoldMine</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
/******************************************************
*******************************************************
** PHPMailer.php
** written by JCS
** Purpose:
** This script was generated
** with the GoldMine Web Import
** script generator. It will generate
** the INI style of web import data
** and email the results to the contact
** entered in the tool.
**
** WARNING: This script requires that you
** have proper setup of your Apache server to
** A. use PHP
** B. setup of your PHP mailer for your SMTP data.
*******************************************************
*******************************************************
*/
function Decode($strValueIn)
{
//Do not modify this function!
$intX = 0;
$intY = 0;
$Temp = "";
$Mod = "";
$intMod =0;
$intTemp = 0;
$ValueOut = "";
$intY = 1;
$strValueOut="";
for ($intX=1; $intX<=((strlen($strValueIn)/2)/2); $intX=$intX+1)
{

$strTemp="";
$strMod="";
if (($intX % 2)==0)
{

$strMod=substr(substr($strValueIn,$intY-1,4),0,2);
$strTemp=substr(substr($strValueIn,$intY-1,4),strlen(substr($strValueIn,$intY-1,4))-(2));
}
else
{

$strMod=substr(substr($strValueIn,$intY-1,4),strlen(substr($strValueIn,$intY-1,4))-(2));
$strTemp=substr(substr($strValueIn,$intY-1,4),0,2);
}

$intMod=hexdec($strMod);
$intTemp=hexdec($strTemp);
$intTemp=$intTemp-$intMod;
$strValueOut=$strValueOut.chr($intTemp);
$intY=$intY+4;

}

return $strValueOut;



}

if ($_POST["GMsubmit"]!="")
{
$Body = "";
//$SendToEmail = Decode($_POST["SendToEmail"]);
//$SMTP = Decode($_POST["SMTP"]); //Your SMTP data may have to be set set on the Apache Server, and this variable is not used.
$OnNewSendGMEmail = $_POST["OnNewSendGMEmail"];
if ($OnNewSendGMEmail!="")
{$OnNewSendGMEmail = Decode($OnNewSendGMEmail);}
else
{$OnNewSendGMEmail = "";}

if ($_POST["OnDUPSendGMEmail"]!="")
{$OnDUPSendGMEmail = Decode($_POST["OnDUPSendGMEmail"]);}
else
{$OnDUPSendGMEmail = "";}
if ($_POST["OnNewAttachTrack"]!="")
{$OnNewAttachTrack = Decode($_POST["OnNewAttachTrack"]);}
else
{$OnNewAttachTrack = "";}
if ($_POST["OnDupAttachTrack"]!="")
{$OnDupAttachTrack = Decode($_POST["OnDupAttachTrack"]);}
else
{$OnDupAttachTrack = "";}
if ($_POST["Word"]!="")
{$Password = Decode($_POST["Word"]);}
else
{$Password = "";}
if ($_POST["DupLogic"]!="")
{$DupLogic = Decode($_POST["DupLogic"]);}
else
{$DupLogic = "";}

$OutputAs = $_POST["OutPutAs"];
$DuplicateCount=0;
$XML = "<gmdata>";

if ($_POST["DuplicateCount"]!="")
{
$DuplicateCount =intval($_POST["DuplicateCount"]);

}
if ($DuplicateCount >0 || $OnNewSendGMEmail!="" || $OnDUPSendGMEmail!="" ||
$OnNewAttachTrack!="" || $OnDupAttachTrack!="")
{
$Body = $Body."[Instructions]\n";
$XML = $XML."<Instructions>";
if ($DuplicateCount > 0)
{
for($counter=0; $counter < $DuplicateCount; $counter++)
{
$RealCount=$counter+1;
$str = "DuplicateChecking$RealCount";
eval("\$str = \"$str\";");
$Body = $Body."DupCheck".$RealCount."=".$_POST[$str]."\n";
//print($str.":".$_POST[$str].";");
$tempVal = $_POST[$str];
if ($tempVal==="EMAIL")
{
$XML = $XML."<DupCheck>EA1</DupCheck>";
}
else
{
if ($tempVal==="WEBSITE")
{
$XML = $XML."<DupCheck>WS1</DupCheck>";
}
else
{
$XML = $XML."<DupCheck>".htmlspecialchars($_POST[$str])."</DupCheck>";
}
}
}
if ($DupLogic !="")
{$Body = $Body."DupLogic=OR\n";}
}
if ($OnNewSendGMEmail!="")
{
$Body = $Body."OnNewSendGMEmail=".$OnNewSendGMEmail."\n";
$XML = $XML."<OnNewSendGMEmail>".htmlspecialchars($OnNewSendGMEmail)."</OnNewSendGMEmail>";

}
if ($OnDUPSendGMEmail!="")
{
$Body = $Body."OnDUPSendGMEmail=".$OnDUPSendGMEmail."\n";
$XML = $XML."<OnDupSendGMEmail>".htmlspecialchars($OnDUPSendGMEmail)."</OnDupSendGMEmail>";

}
if ($OnNewAttachTrack!="")
{
$comma =strpos($OnNewAttachTrack, ",");
$Body = $Body."OnNewAttachTrack=".$OnNewAttachTrack."\n";
if ($comma =="")
{
$XML = $XML."<OnNewAttachTrack>".htmlspecialchars($OnNewAttachTrack)."</OnNewAttachTrack>";
}
else
{
list($track, $user) = split(',', $OnNewAttachTrack,2);
$XML = $XML."<OnNewAttachTrack User=".chr(34).htmlspecialchars($user).chr(34).">".htmlspecialchars($track)."</OnNewAttachTrack>";
}
}
if ($OnDupAttachTrack!="")
{
$comma =strpos($OnDupAttachTrack, ",");
$Body = $Body."OnDupAttachTrack=".$OnDupAttachTrack."\n";
if ($comma =="")
{
$XML = $XML."<OnDupAttachTrack>".htmlspecialchars($OnDupAttachTrack)."</OnDupAttachTrack>";
}
else
{
list($track, $user) = split(',', $OnDupAttachTrack,2);
$XML = $XML."<OnDupAttachTrack User=".chr(34).htmlspecialchars($user).chr(34).">".htmlspecialchars($track)."</OnDupAttachTrack>";
}


}
if ($Password!="")
{
$Body = $Body."Password=".$Password."\n";
$XML = $XML."<Password>".htmlspecialchars($Password)."</Password>";

}
if ($DupLogic!="")
{
$XML = $XML."<DupLogic>OR</DupLogic>";
}
else
{
$XML = $XML."<DupLogic>AND</DupLogic>";
}

$XML = $XML."</Instructions>";
}
$Body = $Body."[Data]\n";
$XML = $XML."<accounts><account>";
$Phone = "";
$EA = "";
$WS = "";
$PR = "";
while(list($key,$value)= each($_POST))
{
eval("$\$key = \"$value\";");


{

if ($key!="GMsubmit" && $key!="SMTP" && $key!="OnNewSendGMEmail" &&
$key!="OnDUPSendGMEmail" && $key!="OnNewAttachTrack" &&
$key!="OnDupAttachTrack" && $key!="SendToEmail" && $key!="DuplicateCount" && $key!="Word" &&
strpos($key, "DuplicateChecking") === false && $key!="OutPutAs" && $key!="DupLogic" && strpos($key, "pretty_") === false)

{


if($value!="")
{
$Body = $Body.$key."=".$value."\n";
if (substr($key,0,5)!="PHONE" && substr($key,0,3)!="FAX" && substr($key, 0, 5)!="EMAIL" && substr($key,0, 7)!="WEBSITE")

{

$PR = $PR."<property name=".chr(34).$key.chr(34)." db_name=".chr(34).$key.chr(34).">";
$PR = $PR."<property_string>".htmlspecialchars($value)."</property_string>";
$PR = $PR."</property>";
}
else
{
if(substr($key,0,5)=="PHONE")
{

$Phone = $Phone."<phone international=".chr(34)."0".chr(34)." type=".chr(34).$key.chr(34)." source_fld=".chr(34).$key.chr(34).">";
$Phone = $Phone."<properties><property name=".chr(34)."phone_number".chr(34)."><property_string>".$value."</property_string></property></properties>";
$Phone = $Phone."</phone>";
}
elseif(substr($key,0,3)=="FAX")
{
$Phone = $Phone."<phone international=".chr(34)."0".chr(34)." type=".chr(34).$key.chr(34)." source_fld=".chr(34).$key.chr(34).">";
$Phone = $Phone."<properties><property name=".chr(34)."phone_number".chr(34)."><property_string>".$value."</property_string></property></properties>";
$Phone = $Phone."</phone>";
}
elseif(substr($key,0,7)=="WEBSITE")
{
$WS = $WS."<website primary=".chr(34)."1".chr(34)." id=".chr(34)."WS1".chr(34).">";
$WS = $WS."<properties><property name=".chr(34)."web_site".chr(34)."><property_string>".$value."</property_string></property></properties>";
$WS = $WS."</website>";
}
elseif(substr($key,0,5)=="EMAIL")
{
$EA = $EA."<email primary=".chr(34)."1".chr(34)." id=".chr(34)."EA1".chr(34).">";
$EA = $EA."<properties><property name=".chr(34)."email_address".chr(34)."><property_string>".$value."</property_string></property></properties>";
$EA = $EA."</email>";
}

}
}

}
}

}
if ($PR !="")
{$XML = $XML."<properties>".$PR."</properties>";}
if($Phone!="")
{
$XML = $XML."<phone_numbers>".$Phone."</phone_numbers>";
}
if($EA!="")
{
$XML = $XML."<emails>".$EA."</emails>";
}
if($WS!="")
{
$XML = $XML."<websites>".$WS."</websites>";
}
$XML = $XML."</account></accounts></gmdata>";
$ToSubject="Web Import";

//The PHP built in function mail() will not raise or cause errors if it fails - so be sure that your PHP server is setup correctly!
if( $OutputAs!="INI")
{
$Body = $XML;
}
ini_set("SMTP", Decode($SMTP));
if(mail(Decode($SendToEmail), $ToSubject, $Body, "From: GoldMine WebImport <no-reply@frontrange.com>\r\nContent-Type: text/x-gm-impdata\r\n" )) {

print "Your data has been recorded successfully!\n\n<!--\n".Decode($SendToEmail)."\n".$ToSubject."\n".$Body."\n\n".$OutputAs."\n\n-->";
}
else
{print("There was a mailer failure.\n\n<!--\n".$Body."\n\n-->");}
}
else
{echo "There was no form data passed.";}
?>
</body>
</html>

Regards

Tim
 
don't post so much code. there is no need for us to see all the option declarations for example. it puts people off trying to help if we see great long lengths of code!

there does not appear to be anything wrong with the goldmine script. all appears correct.

so the problem may be in your php.ini file: does it point to a valid smtp server that will accept relays from the web-server?

test this with a simple script that uses the mail() function (see php.net for the syntax).


 
Hi jpadie

Sorry about the lenght of the code, just thought it might help people, point taken though

Can you tell me how to find the php.ini file?

Regards

Tim
 
I did a google search for the question you asked - and got a result that was relevant in the first hit.

How about you do some searching (google and php.net will provide the answers you need with incredibly little effort).

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
I searched PHP.net but I dont have php on my machine I am using a host to use php

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top