I have a job listing module and I've added an attachment to the form below to allow the users to send an email with attachment CV’s.
The form is working fine but I can not get any attachment with the email, I used $xoopsMailer->charSet but it doesn't work.
Could you please help me to know; what is my problem with this form? Why it doesn't send the attachment with the email?
Below in RED what I have been added to the form to allow attachment.
foreach ($_POST as $k => $v) {
${$k} = $v;
}
if ($submit) {
include("header.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 = ""._JOBS_ORAT." $tele";
} else {
$teles = "";
}
$message .= ""._JOBS_REMINDANN." $type : $title "._JOBS_FROMANNOF." $sitename\n";
$message .= ""._JOBS_MESSFROM." $namep $post ".$meta['title']."\n\n";
$message .= "\n";
$message .= stripslashes("$messtext\n\n");
$message .= " "._JOBS_ENDMESS."\n\n";
$message .= ""._JOBS_CANJOINT." $namep "._JOBS_TO." $post $teles \n\n";
$message .= "End of message \n\n";
$subject = ""._JOBS_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();
$message .= "\n".$_SERVER['REMOTE_ADDR']."\n";
$adsubject = $xoopsConfig['sitename']." Job Reply ";
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setToEmails($xoopsConfig['adminmail']);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject($adsubject);
$xoopsMailer->setBody($message);
$xoopsMailer->charSet($attachment); $xoopsMailer->send();
}
redirect_header("index.php",1,_JOBS_MESSEND);
exit();
} else {
$lid = isset( $_GET['lid'] ) ? $_GET['lid'] : '' ;
include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
OpenTable();
echo "";
echo "
"._JOBS_CONTACTAUTOR."";
echo ""._JOBS_TEXTAUTO."
";
echo "
";
CloseTable();
include(XOOPS_ROOT_PATH."/footer.php");
}
?>
2
charSet is an attribute, not a method. And you are trying to add the attachment to the charset? Any particular reason for that?
try looking into $xoopsMailer->multimailer->addAttachment() (in /class/mail/phpmailer/class.phpmailer.php)
3
Hi there,
I am not a PHP programmer, but I need to get this form working.
I've changed $xoopsMailer->charSet($attachment); to $xoopsMailer->multimailer->addAttachment(); but still the form does not send any attachment.
Could you please let know what do I have to add to the form to get it work?
Thanks.
149 user(s) are online (107 user(s) are browsing Support Forums)
Members: 0
Guests: 149
more...
Stats |
Goal: |
$100.00 |
Due Date: |
Dec 31 |
Gross Amount: |
$0.00 |
Net Balance: |
$0.00 |
Left to go: |
$100.00 |
|