From owner-freebsd-isp@FreeBSD.ORG Tue Dec 2 15:17:56 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 0AA7E16A4CE for ; Tue, 2 Dec 2003 15:17:56 -0800 (PST) Received: from smtp.time-on.com (neptune.tcrs.com.au [202.182.128.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31CB743FCB for ; Tue, 2 Dec 2003 15:17:53 -0800 (PST) (envelope-from bsd@time-on.com) Received: from time-on.com (neptune.tcrs.com.au [202.182.128.9]) by smtp.time-on.com (8.10.1/8.10.1) with SMTP id hB2NJEA15889; Wed, 3 Dec 2003 10:19:15 +1100 (EST) From: "bsd_tech" Sender: bsd@time-on.com To: swenson@heronetwork.com, freebsd-isp@freebsd.org Date: Wed, 03 Dec 2003 10:17:33 +1100 X-Mailer: CWMail Web to Mail Gateway 2.8a, http://netwinsite.com/top_mail.htm Message-id: <3fcd1df3.3e0d.0@time-on.com> X-User-Info: 211.30.116.180 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: sendmail using phpmail X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: bsd@time-on.com List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2003 23:17:56 -0000 Thank you all for your help I now have found the problem and it is now working >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 ----- > $_toEmailAddress = "info@somedomain.com"; > $_ccEmailAddress = ""; > //$_bccEmailAddress = "alternate@destination.com"; > > $_subject = $_POST[ "subject" ]; > $_comments = $_POST[ "message" ]; > $phone = $_POST[ "phoneNumber" ]; > $name = $_POST[ "name" ]; > $_from = "\"$name\" <" . $_POST[ "email" ] . ">"; > > 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 > > > >
> align="center"> > > > > > > > > > > > > > > > > > > >
Name:
Email: >Required
Send a copy of this message to me too: type="checkbox" name="cc_me" checked="" value="ON"> >

Phone:

size="20">
>
>

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

>
>
> >

Input message here.

> >

name="Submit" style="font-family: arial, helvetica, san-serif; font-size: 13px; >color: #ffffff; background: #006633;">

>
>
>
>
>
> > >----- cut here ----- > >Cheers, >Scottie > >_______________________________________________ >freebsd-isp@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-isp >To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org" > > http://netwinsite.com/dbabble/