Hi All,
I have a job listing module and I've added an attachment option to the contact form to allow the users to email the CV’s.
Can anyone please help me with this PHP code to allow sending the attachment to Email?
// ----------------------------------------------------------------------- //
// Jobs for XOOPS 2.0x //
// By John Mordo from the myAds 2.04 Module //
// All Original credits left below this //
// //
// //
// //
//
// ------------------------------------------------------------------------- //
// E-Xoops: Content Management for the Masses //
// <
http://www.e-xoops.com > //
// ------------------------------------------------------------------------- //
// Original Author: Pascal Le Boustouller
// Author Website :
pascal.e-xoops@perso-search.com// Licence Type : GPL
// ------------------------------------------------------------------------- //
foreach ($HTTP_POST_VARS as $k => $v) {
${$k} = $v;
}
if ($submit) {
include("header.php");
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
global $xoopsConfig, $xoopsDB, $myts, $meta;
$result = $xoopsDB->query("select email, submitter, title, type, company, description, requirements FROM ".$xoopsDB->prefix("jobs_listing")." WHERE lid = '$id'");
while(list($email, $submitter, $title, $type, $company, $description, $requirements) = $xoopsDB->fetchRow($result)) {
$title = $myts->makeTboxData4Show($title);
$type = $myts->makeTboxData4Show($type);
$company = $myts->makeTboxData4Show($company);
$description = $myts->makeTboxData4Show($description);
$requirements = $myts->makeTboxData4Show($requirements);
$submitter = $myts->makeTboxData4Show($submitter);
if ($tele) {
$teles = ""._CLA_ORAT." $tele";
} else {
$teles = "";
}
$message = ""._CLA_MESSFROM." $namep $post ".$meta['title']."\n\n\n";
$message .= ""._CLA_REMINDANN." $type : $title\n"._CLA_MESSAGETEXT." : $description\n\n";
$message .= " "._CLA_STARTMESS." $namep "._CLA_FROMANNOF."\n";
$message .= "$messtext\n\n";
$message .= "--------------- "._CLA_ENDMESS." -------------------\n\n";
$message .= ""._CLA_CANJOINT." $namep "._CLA_TO." $post $teles \n\n";
$message .= "End of message \n\n";
$subject = ""._CLA_CONTACTAFTERANN."";
$mail =& getMailer();
$mail->useMail();
//$mail->setFromName($meta['title']);
$mail->setFromEmail($post);
$mail->setToEmails($email);
$mail->setSubject($subject);
$mail->setBody($message);
$mail->send();
echo $mail->getErrors();
}
redirect_header("index.php",1,_CLA_MESSEND);
exit();
} else {
$lid = isset( $HTTP_GET_VARS['lid'] ) ? $HTTP_GET_VARS['lid'] : '' ;
include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
OpenTable();
echo "";
echo "
"._CLA_CONTACTAUTOR."";
echo ""._CLA_TEXTAUTO."
";
echo "
";
CloseTable();
include(XOOPS_ROOT_PATH."/footer.php");
}
?>