SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    mail(), postfix and bounces

    Ok, hopefuly there's somebody here who can answer this for me.

    Using FreeBSD 6.4, Postfix1, and PHP5. Function mail() send stuff just fine, but it doesn't generate bounces when it should. I know about the -f param for sendmail, but not sure if it works with Postfix. Also, I've never seen an example of it being set properly in code.

    What's the deal? Hep!!!

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,782
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Can you show us your code that isn't working? Hard to see what is making your code screwy.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    EEK. Um, some sensative info in the full script, but here's the safe and pertinent part.

    PHP Code:
     
    // define email part boundary
    $email_boundary "<<----------[" md5(time()) . "]---------->>";
    // assemble the header
    $header "From: {$email_from}\n";
    $header .= "MIME-Version: 1.0\n";
    $header .= "Content-Type: multipart/mixed;\n";
    $header .= " boundary=\"{$email_boundary}\"";
    // which message do we use
    if ($sendreport === "on")
    {
    $email_message $email_message_two;
    }
    else
    {
    $email_message $email_message_one;
    }
    // assemble the message
    $message "This is a multi-part message in MIME format.\n\n";
    $message .= "--{$email_boundary}\n";
    $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
    $message .= "Content-Transfer-Encoding: 7bit\n\n";
    $message .= "{$email_message}\n\n";
    $message .= "--{$email_boundary}\n";
    // assemble attachment one
    $message .= "Content-Type: {\"application/octet-stream\"};\n";
    $message .= " name=\"{$attach_one}\"\n";
    $message .= "Content-Disposition: attachment;\n";
    $message .= " filename=\"{$attach_one}\"\n";
    $message .= "Content-Transfer-Encoding: base64\n\n";
    $message .= "{$attach_one_data}\n\n";
    $message .= "--{$email_boundary}\n";
    // append attachment two if needed
    if ($sendreport === "on")
    {
    $message .= "Content-Type: {\"application/octet-stream\"};\n";
    $message .= " name=\"{$attach_two}\"\n";
    $message .= "Content-Disposition: attachment;\n";
    $message .= " filename=\"{$attach_two}\"\n";
    $message .= "Content-Transfer-Encoding: base64\n\n";
    $message .= "{$attach_two_data}\n\n";
    $message .= "--{$email_boundary}\n";
    }
    // which subject do we use
    if ($sendreport === "on")
    {
    $email_subject $email_subject_two;
    }
    else
    {
    $email_subject $email_subject_one;
    }
    // attempt to send the mail
    $success = @mail($emailaddress$email_subject$message$header); 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •