Re: mail function -- not functioning for me!

From: Date: Wed, 19 Jul 2000 01:39:13 +0000
Subject: Re: mail function -- not functioning for me!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7193@lists.php.net to get a copy of this message
This is primarily directed at Dave Turnbull I have the same setup (except OSX 1.0) and no luck with mail(). I tried bypassing mail on the advice of some folks here; here is the code that I worked from: > <?php > > $fd = popen("/path/to/sendmail -oi -t -oeq", "w"); > > fwrite($fd, "From: Joe <joe@joe.com>\n"); > fwrite($fd, "To: Bob <bob@bob.com>\n"); > fwrite($fd, "Subject: blah blah\n"); > fwrite($fd, "\n"); > fwrite($fd, "my message, etc...\n"); > > pclose($fd); > > ?> But it did nothing except reveal that errors with popen() aren't reported until pclose(). You can track back through the last few digests under 'Why is this not a bug?' as the subject line if you're interested. I've tried the quoted sendmail location to no effect - if you come up with anything, I'd really appreciate it if you could cc me on it. I've just unsubscribed (after 1000 messages!) but spotted your message and I'll probably resubscribe to see how it turns out. There aren't many OSX users here, but there are a few, so if I can help out with testing or suggestions, I'm available... dan donaldson omnivore@sympatico.ca > Hi Dave, > > I chased one like this before and someone on this list helped me out. > The sendmail_path must be in double quotes (even the default provided). > > In your php.ini find > ; Module Settings ; > [mail function] > sendmail_path = "/usr/sbin/sendmail -t" > > It worked for me, hope it helps you, too! > mike w. > > Greg Donald wrote: > > > > On Tue, 18 Jul 2000, Dave Turnbull wrote: > > > > > PHP 4.0.1pl2 > > > Mac OS X 1.2 > > > Apache 1.3.12 > > > > > > I have been trying to get a simple mail function to work with PHP -- I want > > > to use it to create a feedback form, eventually. I copied the code from a > > > book, and they say it should work. But, of course, it is not. the actuall > > > code will follow, but I don't think it's an error in the code, because when > > > I put a deliberate error in, php DOES generate an error message for me. > > > Otherwise, no error messages. > > > > > > I think the problem lies in the interaction between PHP and sendmail. The > > > server tells me sendmail is in /usr/sbin and that it is running. This is the > > > path I put in the php.ini, on the "sendmail_path =" line. This line is not > > > commented. I have tried various e-mail send-to addresses, just in case. I > > > know PHP is tracking vars, because it displays the "thank you" message > > > correctly. I also, therefore, know that is not a problem of file location, > > > etc. > > > > > > **CODE FOR HTML FORM** > > > <HTML> > > > <HEAD> > > > <TITLE>Feedback</TITLE> > > > </HEAD> > > > <BODY> > > > > > > > > > <FORM method="POST" action="/php/sendfeedback.php"> > > > > > > <P>Your Name:<br> > > > <INPUT type="text" name="sender_name" size=30></p> > > > > > > <P>Your E-Mail Address:<br> > > > <INPUT type="text" name="sender_email" size=30></p> > > > > > > <P>Your Message:<br> > > > <textarea name="message" cols=30 rows=5></textarea> > > > </p> > > > > > > <INPUT type="submit" value="Send This Form"> > > > > > > </FORM> > > > > > > </BODY> > > > </HTML> > > > **END OF HTML CODE** > > > > > > **CODE FOR PROCESSING SCRIPT** > > > <?php > > > > > > $msg = "Sender's Full Name:\t$sender_name\n"; > > > $msg .= "Sender's E-Mail:\t$sender_email\n"; > > > $msg .= "Sender's Message:\t$message\n\n"; > > > > > > // use two newline characters at the end of your content, > > > // or to insert additional spacing > > > > > > $mailheaders = "From: ASD Web Site <> \n"; > > > $mailheaders .= "Reply-To: $sender_email\n\n"; > > > > > > mail("turnbull@enol.com", "Feedback Form", $msg, $mailheaders); > > > > > > echo "<H1 align=center>Thank You, $sender_name</h1>"; > > > echo "<p align=center>We appreciate your feedback.</p>"; > > > > > > ?> > > > **END OF PHP SCRIPT** > > > > > > Any ideas? > > > > > > Dave > > > > > > > > > > > > > Yes, do you have some type of mail transfer agent installed? I have no > > idea what's available for Mac, but I know you have to tell php what to use > > to send mail. > > > > Greg > > > > -- > > ------------------------------------------------------------------------ > > destiney - (des-ti-ny) - n. 1. deity of all things "html", 2. common > > internet addict, 3. lover of late 80's heavy metal music, 4. Activist > > for the terminally un-elite; see also - cool guy, des, mr. php... > > > > It's 4:00am, your web site is still up, why are you? > > http://destiney.com/ > > ------------------------------------------------------------------------ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > ----------------------------------------------------- omnivore: omnivore@sympatico.ca Networked and Desktop interactive technologies tel: +1 416 603 3309 Build surveys online with surveys123: http://www.surveys123.com Your Online Science & Astronomy Superstore: http://www.e-sci.com

« previous php.general (#7193) next »