hi there
i've been using the same trusty old class using mail() for years, but on this new server it appears the headers are getting ignored by the mail client and showing from: as being from the name of the shared server the script is now sitting on.

eg: from:<mymail@theserver.webfusion.co.uk>

the format i am using for my header is:
"From:myrecipient\nReply-To:mail@mymail.com\n"

any ideas guys?

    the headers should be separated by a \r\n rather than just a \n, but i dont think thats whats causing the problem. try adding the 5th parameter to the mail call, like "-fyou@yoursite.com". this should tell sendmail to use that email address as the sender. those additional headers are not actually parsed by the mta, but by php, so if it doesnt recognize them properly, they may not work as you want.

      hey drew

      thanks for the reply, could you show me how that might look?

      alex

        mail($recipient, $subject, $message, $headers, '-fyou@yoursite.com');
        

        thats how you add the flag to mail.

          hey drew thanks again, thats how i have it set, its still not working though :-(

          damn these shared hosting packages...

            crazy stuff - if i use an email address in the From: header it works fine. if i use a regular name it breaks...

              php should accept from addresses in the format of "Name Here" <email@here.com> but if it seems to be causing problems, then I guess using only the email address is the solution to use for now.

                I've been using these headers for years with no problem:

                function email_headerTEXT($from_name, $from_email)
                {
                  $header .= "From: $from_name<$from_email>\n";
                  $header .= "MIME-Version: 1.0\n";
                  $header .= "Reply-To: $from_name<$from_email>\n";
                  $header .= "X-Priority: 3\n";
                  $header .= "X-Mailer: phpmailer [version 1.40]\n";
                  $header .= "Return-Path: $from_email\n";
                  return $header;
                }

                and:

                mail("Name Here<email@here.com>", $subject, $message, $headers, "-f email@here.com");

                Just seperate the -f from the email you@yoursite.com (You need a space).

                  Write a Reply...