View Single Post
  #4  
Old 5th September 2006, 13:07
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,033
Thanks: 261
Thanked 150 Times in 130 Posts
Default

Quote:
Originally Posted by Ben
Can you post the php code?

What you additianlly can do is to set the -f parameter for sendmail in the php.ini to fix set the from address, wich is a real from address and no x-from address...
This is part of the password recover code:

PHP Code:
if($_REQUEST['recover'])
{
    
STemplate::assign('receiver_name'$rs->fields['username']);
    
STemplate::assign('receiver_fname'$rs->fields['fname']);
    
STemplate::assign('receiver_lname'$rs->fields['lname']);
    
STemplate::assign('password'$rs->fields['pwd']);
    
    
$rs $conn->execute("select * from emailinfo where email_id='recover_password'");
    
$subj $rs->fields['email_subject'];
    
$email_path $rs->fields['email_path'];
    
$body STemplate::fetch($email_path);
    @
mailing($_REQUEST['email'], $config['site_name'], $config['admin_email'], $subj$body);
    
    
$msg "An email is sent to your email address. Plese check it now.";
    
    
header("Location: recoverpass.php?msg=$msg");

This is how the main mail function looks:
PHP Code:
//MAIL FUNCTIION
function mailing($to,$name,$from,$subj,$body,$bcc=""
{
    global 
$SERVER_NAME;
    
$subj=nl2br($subj);
    
$body=nl2br($body);
    
$recipient $to;
    if(
$bcc!=""$headers "Bcc: " $bcc."\n";
    
$headers .= "From: " $from "\n";
    
//$headers .= "X-Sender: <" . "$to" . ">\n";
    //$headers .= "Return-Path: <" . "$to" . ">\n";
    //$headers .= "Error-To: <" . "$to" . ">\n";
    
$headers .= "Content-Type: text/html\n";
    
mail("$recipient","$subj","$body","$headers");

and a small part of the signup form

PHP Code:
                    {
                            
$expired_time date("Y-m-d H:i:s"strtotime("+".$rs->fields['trial_period']." day"));
                    
                            
$sql "update subscriber set
                                    pack_id=$_REQUEST[pack_id],
                                    subscribe_time='"
.date("Y-m-d H:i:s")."',
                                    expired_time='$expired_time'
                                    where UID = $userid"
;
                            
$conn->execute($sql);
                            
                            
SESSION_REGISTER("UID");            $_SESSION[UID]=$userid;
                            
SESSION_REGISTER("EMAIL");            $_SESSION[EMAIL]="$_REQUEST[email]";
                            
SESSION_REGISTER("USERNAME");        $_SESSION[USERNAME]="$_REQUEST[username]";
                            
SESSION_REGISTER("EMAILVERIFIED");    $_SESSION[EMAILVERIFIED]="no";
                            
####################### Email                
                            
$ran=time().rand(1,99999999);
                            
$sql="update verify as v, signup as s set
                                            v.vcode='$ran',
                                            s.emailverified='no' WHERE v.UID=s.UID and v.UID='$userid'"
;
                            
$conn->execute($sql);
                            
STemplate::assign('vcode',$ran);

                            
$to=$_SESSION[EMAIL];
                            
$name=$config['site_name'];
                            
$from=$config['admin_email'];
                            
$rs $conn->execute("select * from emailinfo where email_id='verify_email'");
                            
$subj $rs->fields['email_subject'];
                            
$email_path $rs->fields['email_path'];
                            
                            
$mailbody=STemplate::fetch($email_path);
                            
mailing($to,$name,$from,$subj,$mailbody);
                            
$msg "A verification email is sent to your address. Please check your email.";
                            
##################### end Email SECTION 

                            
if($_REQUEST['next']!="")$page=$_REQUEST['next'].".php";else $page="invite_signup.php";
                            if(
$_REQUEST['add']!="")$add=base64_decode($add);
                                    
header("Location:$config[baseurl]/$page?$add");exit;
                    } 
Not sure if this is all what is needed to fix the problem (it's not my code)

Last edited by edge; 5th September 2006 at 13:14.
Reply With Quote