Email Problems - with sender.

Discussion in 'PHP' started by photosales.co.nz, Jul 6, 2007.

  1. #1
    Hi there people, I have a bit of an issue with sending emai from my server.

    When it sends, it shows the return address as being

    The information that should be sent is <? echo $setting->support_email; ?> which is - it pulls that info from another area.

    Now when it sends the email, it is not showing the correct return address. Here is the part of the script that is sending the info:
    // Pull emails
    $results = mysql_query("SELECT $row FROM $table") or die("Could not pull emails<br>".mysql_error());
    $sent = mysql_num_rows($results);
    
    if($row = mysql_fetch_assoc($results)) {
                    
        do {
            
            
            $email_body = $body;
            
            $subject = $sub;
    	  $email_body = str_replace("\\","",$_POST['msg']);
            $email_header = "From: $from\n";
            $email_header .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
            $email_header .= "Return-Path: <$return>\n";
            $email_header .= "Content-type: text/html; charset=iso-8859-1\r\n";
            
            mail($row["email"], $subject, $email_body, $email_header);
            
        } while ($row = mysql_fetch_assoc($results));
            
            
    } else {
        echo "No Email Addresses to send.";
    } ?> Your message has been sent<br>
    
    Code (markup):
    Any thoughts?
     
    photosales.co.nz, Jul 6, 2007 IP
  2. photosales.co.nz

    photosales.co.nz Peon

    Messages:
    371
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Could it be that the from part in the form that is being submitted looks like:

    New Zealand Photos, NZ Images & Stock Photography <steve@ccmarine.co.nz>
     
    photosales.co.nz, Jul 6, 2007 IP
  3. photosales.co.nz

    photosales.co.nz Peon

    Messages:
    371
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Any ideas?
     
    photosales.co.nz, Jul 6, 2007 IP
  4. photosales.co.nz

    photosales.co.nz Peon

    Messages:
    371
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Still stuck on this one....
     
    photosales.co.nz, Jul 7, 2007 IP