Well, i'm a stubborn newbie. Couldn't wait for a reply and poked and picked and got this bit of code to work. It may not be right, but it works on my site.
Complete code for the contact.php page in xdirectory:
//
// ------------------------------------------------------------------------- //
// 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
// ------------------------------------------------------------------------- //
if ($_POST['submit']) {
include("header.php");
global $xoopsConfig, $xoopsDB, $myts, $meta, $message;
$lid = $_POST['id'];
$result = $xoopsDB->query("SELECT title, email FROM ".$xoopsDB->prefix("xdir_links")." WHERE lid = '$lid'");
while(list($title, $email) = $xoopsDB->fetchRow($result)) {
if ($_POST['tele']) {
$teles = "Phone: ".$_POST['tele'];
} else {
$teles = "";
}
$message .= "Message from ".$_POST['namep']."\ne-Mail: ".$_POST['post']." ".$meta['title']."\n";
$message .= $_POST['namep']." wrote:\n";
$message .= $_POST['messtext']."\n\n\n";
$message .= "This message was sent by ".$_POST['namep']." using the e-Mail form on {X_SITENAME}. \n\n\n";
$subject = "Email Submission from {X_SITENAME}";
$mail =& getMailer();
$mail->useMail();
$mail->setFromEmail($_POST['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 = $_GET['lid'];
include("header.php");
include(XOOPS_ROOT_PATH."/header.php");
OpenTable();
$result = $xoopsDB->query("SELECT title, email FROM ".$xoopsDB->prefix("xdir_links")." WHERE lid = '$lid'");
while(list($title, $email) = $xoopsDB->fetchRow($result)) {
echo "";
echo "
";
echo "Send a message to:
$title";
echo "
";
CloseTable();
include(XOOPS_ROOT_PATH."/footer.php");
}
}
?>