From owner-freebsd-isp@FreeBSD.ORG Tue Dec 2 10:24:26 2003 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EB3216A4CE for ; Tue, 2 Dec 2003 10:24:26 -0800 (PST) Received: from mx1.heronetwork.com (mail.heronetwork.com [216.254.62.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5F3543FA3 for ; Tue, 2 Dec 2003 10:24:24 -0800 (PST) (envelope-from swenson@heronetwork.com) Received: by mx1.heronetwork.com (Postfix, from userid 1003) id A5122A5EAC; Tue, 2 Dec 2003 10:23:19 -0800 (PST) Received: from heronetwork.com (ON-01-FW.heronetwork.com [216.254.62.177]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.heronetwork.com (Postfix) with ESMTP id 4A963A597E; Tue, 2 Dec 2003 10:23:08 -0800 (PST) Message-ID: <3FCCD890.6010205@heronetwork.com> Date: Tue, 02 Dec 2003 10:23:12 -0800 From: Scottie Swenson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: bsd@time-on.com References: <3fcc2a97.2cde.0@time-on.com> In-Reply-To: <3fcc2a97.2cde.0@time-on.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Level: * X-Spam-Status: No, hits=1.5 required=8.0 tests=HTML_30_40,HTML_MESSAGE, HTML_TITLE_UNTITLED autolearn=no version=2.60 cc: freebsd-isp@freebsd.org Subject: Re: sendmail using phpmail X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2003 18:24:26 -0000 Greetings, We host a lot of virtual domain web sites on BSD boxes that are running PHP forms and sending out tons of email. Sometimes PHP doesn't figure out the right path for the sendmail program. So your first check is to make sure PHP is using sendmail correctly for your particular box. The builting phpinfo() command puts out a nice summary of your php build including all the build options. You need to make sure PHP was compiled with the correct path to sendmail. A php check web page: ----- cut here ----- ----- cut here ----- In the CORE PHP configuration section look for the setting 'sendmail_path'. Ours is set to '/usr/sbin/sendmail -t -i' You can test to see if PHP can send email using the code I included bellow. Given that PHP can send email phpmail should start working. I am not sure how phpmail handles the mail but we have found email works a LOT better if some extra header information is included. Here is the PHP code you can use to check to see if PHP is able send messages from a functioning email form on a BSD box: email.php: ----- cut here ----- "; if ( $_POST[ "cc_me" ] == "on" ) { $_ccEmailAddress = $_from; } $message = "\n\nName: " . $name . "\n"; $message .= "Email: " . $_from . "\n"; $message .= "Phone Number: " . $phone . "\n"; $message .= "\nMessage: " . $_comments . "\n\n"; $_headers = ""; //$_headers .= "MIME-Version: 1.0\r\n"; //$_headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $_headers .= "From: $_from\r\n"; //$_headers .= "To: ".$_toEmailAddress."\r\n"; if (! empty($_bccEmailAddress) ) { $_headers .= "BCC: ".$_bccEmailAddress."\r\n"; } if (! empty($_ccEmailAddress) ) { $_headers .= "CC: ".$_ccEmailAddress."\r\n"; } $_headers .= "Reply-To: $_from\r\n"; $_headers .= "X-Priority: 1\r\n"; $_headers .= "X-MSMail-Priority: High\r\n"; $_headers .= "X-Mailer: Hero Network Email System"; $mailresponse = mail("$_toEmailAddress", "$_subject", "$message", $_headers ); ?> ----- cut here ----- email_form.html ----- cut here ----- Untitled
Name:
Email: Required
Send a copy of this message to me too:

Phone:


To best route your email, please select the most appropriate category:



Input message here.




----- cut here ----- Cheers, Scottie