...

View Full Version : sending a form as text in email (not attachment)



naqvia
03-04-2009, 05:23 AM
Hi,

My form content that user enters is always sent as a attachment... i want it to be in the email message instead. I played around with it, but still no luck. Here is the original code where I am sending the form..


$mailformMsg = "<table width=650 cellspacing=0 cellpadding=0 border=0>\n";
$mailformMsg .= "<tr>\n";
$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=235 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= " <b>CLASS INFORMATION</b>";
$mailformMsg .= " </div></td>";
$mailformMsg .= " <td width=400 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= "<b style='font-size:12pt;'>" . $classInfo[$curClass][0] . "</b><br>\n";
$mailformMsg .= $classInfo[$curClass][4] . "<br>\n";
$mailformMsg .= "AC Member Price: $" . $classInfo[$curClass][1] . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Non-Member Price:&nbsp;";
if ($classInfo[$curClass][3]==0) {
$mailformMsg .= "<i>Not open to non-members.</i>\n<br><br>\n";
} else {
$mailformMsg .= "$" . $classInfo[$curClass][2] . "\n<br><br>\n";
}
$mailformMsg .= " </div></td>";
$mailformMsg .= "</tr><tr>";

$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=235 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= " <b>REGISTERING COMPANY INFORMATION</b>";
$mailformMsg .= " </div></td>";
$mailformMsg .= " <td width=400 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= "<b>" . $companyName." (";
if ($agcMember==1) {
$mailformMsg .= "AGC Member";
} else if ($agcMember==0) {
$mailformMsg .= "Non-Member";
}
$mailformMsg .= ")</b><br>\n";
$mailformMsg .= "Contact: " . $contactName. "<br>\n";
$mailformMsg .= "Phone: " . $contactPhone. "<br>\n";
$mailformMsg .= "Email: " . $contactEmail. "<br>\n";
$mailformMsg .= "IP Address: " .$_SERVER['REMOTE_ADDR']." (for anti-fraud purposes)<br><br>\n";
$mailformMsg .= " </div></td>";
$mailformMsg .= "</tr><tr>";

$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=235 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= " <b>PARTICIPANTS</b>";
$mailformMsg .= " </div></td>";
$mailformMsg .= " <td width=400 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$x=1;
foreach ($reg as $thisRegistrant) {
$mailformMsg .= $regf[$x]. " ". $thisRegistrant." (".$rege[$x].")<br>\n";
$x+=1;
}
$mailformMsg .= " </div><br></td>";
$mailformMsg .= "</tr><tr>";

$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=235 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= " <b>PRICING AND PAYMENT INFORMATION</b>";
$mailformMsg .= " </div></td>";
$mailformMsg .= " <td width=400 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
if ($agcMember==0) {
$classPrice = $classInfo[$curClass][2];
} else if ($agcMember==1) {
$classPrice = $classInfo[$curClass][1];
}

$mailformMsg .= $numReg. " Participants x $" . $classPrice. " each: <b style='font-size:12pt;'>$" . ($classPrice*$numReg) ."</b><br>";
$mailformMsg .= "Registrant will pay " . $paymentOp. "<br>\n";

if ($paymentOp=="by invoice.") {
$mailformMsg .= "<br>Class fee payable to: <b> Diego Chaper, Inc</b><br><br><b>Please write the name and date of the class on the check.</b><br><br>Mail to <b>62 FS, San Diego, CA, 92121</b>.<br><br><b>Please note: You will not be rostered for this class until the check clears.</b>";
} else if ($paymentOp=="by credit card.") {
$mailformMsg .= "<br>Please fax your completed payment form to <b>(858) 558-8444</b>.";
echo "<form id='printForm' target='printFormWin' action='http://www.ad.org/calendar/registration.php' method=POST>";
echo "<input type='hidden' name='companyName' value='" . $companyName. "'>";
if ($agcMember==1) {
echo "<input type='hidden' name='agcMember' value='1'>";
} else if ($agcMember==0) {
echo "<input type='hidden' name='agcMember' value='0'>";
}
echo "<input type='hidden' name='contactName' value='" . $contactName. "'>";
echo "<input type='hidden' name='contactPhone' value='" . $contactPhone. "'>";
echo "<input type='hidden' name='contactEmail' value='" . $contactEmail. "'>";
echo "<input type='hidden' name='numReg' value='" . $numReg. "'>";
for ($x=1; $x<=$numReg; $x+=1) {
echo "<input type='hidden' name='reg" .$x."' value='" .$reg[$x]."'>";
echo "<input type='hidden' name='regf" .$x."' value='" .$regf[$x]."'>";
echo "<input type='hidden' name='regemail" .$x."' value='" .$rege[$x]."'>";
}
echo "<input type='hidden' name='classType' value='" .$classType."'>";
echo "<input type='hidden' name='className' value='" .$className."'>";
echo "<input type='hidden' name='curPage' value='printform'>";
echo "</form>";
}
$mailformMsg .= " </div></td>\n";
$mailformMsg .= "</tr><tr>\n";
$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=635 colspan=2 align=left><div style='font-size:12pt;font-family:Arial;'>\n";
$mailformMsg .= " <br><hr noshade color='#CC0033' width=635>\n";
$mailformMsg .= " </div></td>\n";

$mailformMsg .= "</tr>";
$mailformMsg .= "</table>\n";

echo $mailformMsg;
if ($classType=="safety") {

}

echo " <b style='padding-left:15px;font-size:12pt;font-family:Arial;'>Thank you for registering! A confirmation email will be sent to you shortly.</b><br><br>";
if ($paymentOp=="by credit card.") {
echo " <a onClick=" .chr(34)."window.open('','printFormWin'); document.getElementById('printForm').submit();" .chr(34)." style='padding-left:15px; cursor:hand;text-decoration:underline;color:#FF0000;'>If you have not printed the payment form yet, please do so now</a>. <br>";
echo " <div style='font-weight:bold;padding-left:15px;color:#FF0000;'>The information you have entered will not be available after you leave this page.</div><br>";
}
echo "<script type='text/javascript'><!--\n";
echo " document.getElementById('divFormLinks').innerHTML='';\n";
echo "--></script>\n";

$mailformSub = "New Registration (".$classInfo[$curClass][0].")";
$mailformFsg = "<html><body><table width=650 cellspacing=0 cellpadding=0 border=0>";
$mailformFsg .= "<tr>";
$mailformFsg .= " <td width=300 valign=bottom style='padding-left:15px;'>";
$mailformFsg .= " <b style='font-size:14pt;font-family:Arial;'>AGC ONLINE REGISTRATION</b><br>";
$mailformFsg .= " </td>";
$mailformFsg .= "</tr><tr>";
$mailformFsg .= " <td width=650 colspan=2 align=right style='padding-left:15px;'>";
$mailformFsg .= " <hr noshade color='#CC0033' width=650>";
$mailformFsg .= " </td>";
$mailformFsg .= "</tr>";
$mailformFsg .= "</table>";

$mailtoAddress = "rfamularo@ad.org amullen@ad.org jessica@ad.org";
$agcManagementLink = "https://mmm1403.sanjose14-verio.com/agcsdo/agcment/rostermanagement.php?cid=".$classID;
$onRoster = "&nbsp;&nbsp;&nbsp;&nbsp;To view this class roster, please click <a href='".$agcManagementLink."'>here</a>.<br><br>";

echo "<!-- ";
mail("jessica@atcf.org,".$mailtoAddress, $mailformSub, $mailformFsg . $onRoster . $mailformMsg, "Content-Type:text/html\nFrom: registrationsystem@ad.org\n", "");

naqvia
03-07-2009, 01:55 AM
anyone please?

sea4me
03-08-2009, 05:52 AM
Nothing seems to be wrong

BTW WRAP PHP CODE WITH PHP TAGS NOT CODE TAGS!!!


$mailformMsg = "<table width=650 cellspacing=0 cellpadding=0 border=0>\n";
$mailformMsg .= "<tr>\n";
$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=235 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= " <b>CLASS INFORMATION</b>";
$mailformMsg .= " </div></td>";
$mailformMsg .= " <td width=400 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= "<b style='font-size:12pt;'>" . $classInfo[$curClass][0] . "</b><br>\n";
$mailformMsg .= $classInfo[$curClass][4] . "<br>\n";
$mailformMsg .= "AC Member Price: $" . $classInfo[$curClass][1] . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Non-Member Price:&nbsp;";
if ($classInfo[$curClass][3]==0) {
$mailformMsg .= "<i>Not open to non-members.</i>\n<br><br>\n";
} else {
$mailformMsg .= "$" . $classInfo[$curClass][2] . "\n<br><br>\n";
}
$mailformMsg .= " </div></td>";
$mailformMsg .= "</tr><tr>";

$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=235 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= " <b>REGISTERING COMPANY INFORMATION</b>";
$mailformMsg .= " </div></td>";
$mailformMsg .= " <td width=400 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= "<b>" . $companyName." (";
if ($agcMember==1) {
$mailformMsg .= "AGC Member";
} else if ($agcMember==0) {
$mailformMsg .= "Non-Member";
}
$mailformMsg .= ")</b><br>\n";
$mailformMsg .= "Contact: " . $contactName. "<br>\n";
$mailformMsg .= "Phone: " . $contactPhone. "<br>\n";
$mailformMsg .= "Email: " . $contactEmail. "<br>\n";
$mailformMsg .= "IP Address: " .$_SERVER['REMOTE_ADDR']." (for anti-fraud purposes)<br><br>\n";
$mailformMsg .= " </div></td>";
$mailformMsg .= "</tr><tr>";

$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=235 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= " <b>PARTICIPANTS</b>";
$mailformMsg .= " </div></td>";
$mailformMsg .= " <td width=400 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$x=1;
foreach ($reg as $thisRegistrant) {
$mailformMsg .= $regf[$x]. " ". $thisRegistrant." (".$rege[$x].")<br>\n";
$x+=1;
}
$mailformMsg .= " </div><br></td>";
$mailformMsg .= "</tr><tr>";

$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=235 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
$mailformMsg .= " <b>PRICING AND PAYMENT INFORMATION</b>";
$mailformMsg .= " </div></td>";
$mailformMsg .= " <td width=400 valign=top align=left><div style='font-size:10pt;font-family:Arial;'>\n";
if ($agcMember==0) {
$classPrice = $classInfo[$curClass][2];
} else if ($agcMember==1) {
$classPrice = $classInfo[$curClass][1];
}

$mailformMsg .= $numReg. " Participants x $" . $classPrice. " each: <b style='font-size:12pt;'>$" . ($classPrice*$numReg) ."</b><br>";
$mailformMsg .= "Registrant will pay " . $paymentOp. "<br>\n";

if ($paymentOp=="by invoice.") {
$mailformMsg .= "<br>Class fee payable to: <b> Diego Chaper, Inc</b><br><br><b>Please write the name and date of the class on the check.</b><br><br>Mail to <b>62 FS, San Diego, CA, 92121</b>.<br><br><b>Please note: You will not be rostered for this class until the check clears.</b>";
} else if ($paymentOp=="by credit card.") {
$mailformMsg .= "<br>Please fax your completed payment form to <b>(858) 558-8444</b>.";
echo "<form id='printForm' target='printFormWin' action='http://www.ad.org/calendar/registration.php' method=POST>";
echo "<input type='hidden' name='companyName' value='" . $companyName. "'>";
if ($agcMember==1) {
echo "<input type='hidden' name='agcMember' value='1'>";
} else if ($agcMember==0) {
echo "<input type='hidden' name='agcMember' value='0'>";
}
echo "<input type='hidden' name='contactName' value='" . $contactName. "'>";
echo "<input type='hidden' name='contactPhone' value='" . $contactPhone. "'>";
echo "<input type='hidden' name='contactEmail' value='" . $contactEmail. "'>";
echo "<input type='hidden' name='numReg' value='" . $numReg. "'>";
for ($x=1; $x<=$numReg; $x+=1) {
echo "<input type='hidden' name='reg" .$x."' value='" .$reg[$x]."'>";
echo "<input type='hidden' name='regf" .$x."' value='" .$regf[$x]."'>";
echo "<input type='hidden' name='regemail" .$x."' value='" .$rege[$x]."'>";
}
echo "<input type='hidden' name='classType' value='" .$classType."'>";
echo "<input type='hidden' name='className' value='" .$className."'>";
echo "<input type='hidden' name='curPage' value='printform'>";
echo "</form>";
}
$mailformMsg .= " </div></td>\n";
$mailformMsg .= "</tr><tr>\n";
$mailformMsg .= " <td width=15></td>";
$mailformMsg .= " <td width=635 colspan=2 align=left><div style='font-size:12pt;font-family:Arial;'>\n";
$mailformMsg .= " <br><hr noshade color='#CC0033' width=635>\n";
$mailformMsg .= " </div></td>\n";

$mailformMsg .= "</tr>";
$mailformMsg .= "</table>\n";

echo $mailformMsg;
if ($classType=="safety") {

}

echo " <b style='padding-left:15px;font-size:12pt;font-family:Arial;'>Thank you for registering! A confirmation email will be sent to you shortly.</b><br><br>";
if ($paymentOp=="by credit card.") {
echo " <a onClick=" .chr(34)."window.open('','printFormWin'); document.getElementById('printForm').submit();" .chr(34)." style='padding-left:15px; cursor:hand;text-decoration:underline;color:#FF0000;'>If you have not printed the payment form yet, please do so now</a>. <br>";
echo " <div style='font-weight:bold;padding-left:15px;color:#FF0000;'>The information you have entered will not be available after you leave this page.</div><br>";
}
echo "<script type='text/javascript'><!--\n";
echo " document.getElementById('divFormLinks').innerHTML='';\n";
echo "--></script>\n";

$mailformSub = "New Registration (".$classInfo[$curClass][0].")";
$mailformFsg = "<html><body><table width=650 cellspacing=0 cellpadding=0 border=0>";
$mailformFsg .= "<tr>";
$mailformFsg .= " <td width=300 valign=bottom style='padding-left:15px;'>";
$mailformFsg .= " <b style='font-size:14pt;font-family:Arial;'>AGC ONLINE REGISTRATION</b><br>";
$mailformFsg .= " </td>";
$mailformFsg .= "</tr><tr>";
$mailformFsg .= " <td width=650 colspan=2 align=right style='padding-left:15px;'>";
$mailformFsg .= " <hr noshade color='#CC0033' width=650>";
$mailformFsg .= " </td>";
$mailformFsg .= "</tr>";
$mailformFsg .= "</table>";

$mailtoAddress = "rfamularo@ad.org amullen@ad.org jessica@ad.org";
$agcManagementLink = "https://mmm1403.sanjose14-verio.com/agcsdo/agcment/rostermanagement.php?cid=".$classID;
$onRoster = "&nbsp;&nbsp;&nbsp;&nbsp;To view this class roster, please click <a href='".$agcManagementLink."'>here</a>.<br><br>";

echo "<!-- ";
mail("jessica@atcf.org,".$mailtoAddress, $mailformSub, $mailformFsg . $onRoster . $mailformMsg, "Content-Type:text/html\nFrom: registrationsystem@ad.org\n", "");

naqvia
03-08-2009, 07:12 AM
The code works.. but it sends the content and emails it as an attachment! I want it in the actual email message...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum