php-windows Digest 24 Jun 2001 12:37:36 -0000 Issue 625 Topics (messages 7997 through 8005): Re: using the PHP4 mail() function in (Newbie) 7997 by: Richard 7998 by: Marnix Ottens 7999 by: Michael Kelley 8001 by: Masato Kataoka Can you use PHP (Windows) on secure https:__port 443 only? 8000 by: Martin Tengowski Help with CSV files 8002 by: RJ Re: Compile PHP under windows 8003 by: Frank M. Kromann PhpDEV 8004 by: Brett Shaw Getting Postgres and PHP to work together 8005 by: Paul Meagher Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Sure, you can send it as a header after the body...Like so: $mailheaders = "From: $mailfrom\n"; mail($mailto, $mailsubject, $mailbody, $mailheaders); Where you establish $mailfrom as who its from Rick ----- Original Message ----- From: "Marnix Ottens" <[EMAIL PROTECTED]> To: "Michael Kelley" <[EMAIL PROTECTED]>; "Peter Haywood" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, June 23, 2001 2:14 AM Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > Just a quick addon question regarding the mail() function. My mail form > works fine but the person who receives the e-mail is seeing "unprivileged > user" as the sender's name. I assume this is displayed by default. > > Can I add a "from" field in the mail() function to display another name than > "unprivileged user"?? > > My current mail() looks like this: > mail ($recipient_email,$subject,$bodymessage); > > regards, > Marnix > > ----- Original Message ----- > From: "Michael Kelley" <[EMAIL PROTECTED]> > To: "Peter Haywood" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Saturday, June 23, 2001 1:23 AM > Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > > > > You need to change > > SMTP = localhost ; for Win32 only > > to > > SMTP = MyMailhost.domain.edu ; for Win32 only > > > > (MyMailHost being your mail service's server -> pop3.hotmail.com) > > If you don't have that then you may need to install a mail service of > > your own ... > > If you need to do that research the archieves I know I've seen a load of > > different free mail services and how to install (I didn't have to do > > that so I'm not going to try to tell you how to do it ...) > > > > > > Peter Haywood wrote: > > > > > Any advice on this would be much appreciated: > > > > > > I am trying to send a simple email. in the php file, i have entered: > > > > > > <?php > > > mail ("[EMAIL PROTECTED]", "This is the Subject", "This is the message > > > body"); > > > ?> > > > > > > when i load the page, i get the following: > > > > > > Warning: Server Error in C:\inetpub\wwwroot/php/tests/test.php on line 2 > > > test.php being the file containing the PHP mail code > > > > > > this is the sendmail info in my php.ini file: > > > > > > [mail function] > > > ; For Win32 only. > > > SMTP = localhost ; for Win32 only > > > > > > ; For Win32 only. > > > sendmail_from = [EMAIL PROTECTED] ; for Win32 only > > > > > > > > > thanks, > > > > > > pete > > > > > > -- > > > > Michael Kelley > > [EMAIL PROTECTED] > > > > Programmer/Systems Analyst I > > New Mexico State University > > Information and Communication Technologies > > Work # (505)-646-1374 > > P.O. Box 30001 > > MSC: 3AT > > Las Cruces, NM 88003 > > > > > > > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Thanks for your reply Richard, but what I meant is how to change the sender's address in the header, not in the message itself. As I don't host my own server I cannot change the php.ini file to replace [EMAIL PROTECTED] Marnix ----- Original Message ----- From: "Richard" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, June 23, 2001 6:20 PM Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > Sure, you can send it as a header after the body...Like so: > > $mailheaders = "From: $mailfrom\n"; > mail($mailto, $mailsubject, $mailbody, $mailheaders); > > Where you establish $mailfrom as who its from > > Rick > > ----- Original Message ----- > From: "Marnix Ottens" <[EMAIL PROTECTED]> > To: "Michael Kelley" <[EMAIL PROTECTED]>; "Peter Haywood" > <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Saturday, June 23, 2001 2:14 AM > Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > > > > Just a quick addon question regarding the mail() function. My mail form > > works fine but the person who receives the e-mail is seeing "unprivileged > > user" as the sender's name. I assume this is displayed by default. > > > > Can I add a "from" field in the mail() function to display another name > than > > "unprivileged user"?? > > > > My current mail() looks like this: > > mail ($recipient_email,$subject,$bodymessage); > > > > regards, > > Marnix > > > > ----- Original Message ----- > > From: "Michael Kelley" <[EMAIL PROTECTED]> > > To: "Peter Haywood" <[EMAIL PROTECTED]> > > Cc: <[EMAIL PROTECTED]> > > Sent: Saturday, June 23, 2001 1:23 AM > > Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > > > > > > > You need to change > > > SMTP = localhost ; for Win32 only > > > to > > > SMTP = MyMailhost.domain.edu ; for Win32 only > > > > > > (MyMailHost being your mail service's server -> pop3.hotmail.com) > > > If you don't have that then you may need to install a mail service of > > > your own ... > > > If you need to do that research the archieves I know I've seen a load of > > > different free mail services and how to install (I didn't have to do > > > that so I'm not going to try to tell you how to do it ...) > > > > > > > > > Peter Haywood wrote: > > > > > > > Any advice on this would be much appreciated: > > > > > > > > I am trying to send a simple email. in the php file, i have entered: > > > > > > > > <?php > > > > mail ("[EMAIL PROTECTED]", "This is the Subject", "This is the > message > > > > body"); > > > > ?> > > > > > > > > when i load the page, i get the following: > > > > > > > > Warning: Server Error in C:\inetpub\wwwroot/php/tests/test.php on line > 2 > > > > test.php being the file containing the PHP mail code > > > > > > > > this is the sendmail info in my php.ini file: > > > > > > > > [mail function] > > > > ; For Win32 only. > > > > SMTP = localhost ; for Win32 only > > > > > > > > ; For Win32 only. > > > > sendmail_from = [EMAIL PROTECTED] ; for Win32 only > > > > > > > > > > > > thanks, > > > > > > > > pete > > > > > > > > > -- > > > > > > Michael Kelley > > > [EMAIL PROTECTED] > > > > > > Programmer/Systems Analyst I > > > New Mexico State University > > > Information and Communication Technologies > > > Work # (505)-646-1374 > > > P.O. Box 30001 > > > MSC: 3AT > > > Las Cruces, NM 88003 > > > > > > > > > > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Not to mention, You may not control the server but I'm assuming you control your "homespace" if you drop a php.ini file into there it will over ride the main ini (but it will only over ride for that branch) Richard wrote: > Sure, you can send it as a header after the body...Like so: > > $mailheaders = "From: $mailfrom\n"; > mail($mailto, $mailsubject, $mailbody, $mailheaders); > > Where you establish $mailfrom as who its from > > Rick > > ----- Original Message ----- > From: "Marnix Ottens" <[EMAIL PROTECTED]> > To: "Michael Kelley" <[EMAIL PROTECTED]>; "Peter Haywood" > <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Saturday, June 23, 2001 2:14 AM > Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > > > >> Just a quick addon question regarding the mail() function. My mail form >> works fine but the person who receives the e-mail is seeing "unprivileged >> user" as the sender's name. I assume this is displayed by default. >> >> Can I add a "from" field in the mail() function to display another name > > than > >> "unprivileged user"?? >> >> My current mail() looks like this: >> mail ($recipient_email,$subject,$bodymessage); >> >> regards, >> Marnix >> >> ----- Original Message ----- >> From: "Michael Kelley" <[EMAIL PROTECTED]> >> To: "Peter Haywood" <[EMAIL PROTECTED]> >> Cc: <[EMAIL PROTECTED]> >> Sent: Saturday, June 23, 2001 1:23 AM >> Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) >> >> >> >>> You need to change >>> SMTP = localhost ; for Win32 only >>> to >>> SMTP = MyMailhost.domain.edu ; for Win32 only >>> >>> (MyMailHost being your mail service's server -> pop3.hotmail.com) >>> If you don't have that then you may need to install a mail service of >>> your own ... >>> If you need to do that research the archieves I know I've seen a load of >>> different free mail services and how to install (I didn't have to do >>> that so I'm not going to try to tell you how to do it ...) >>> >>> >>> Peter Haywood wrote: >>> >>> >>>> Any advice on this would be much appreciated: >>>> >>>> I am trying to send a simple email. in the php file, i have entered: >>>> >>>> <?php >>>> mail ("[EMAIL PROTECTED]", "This is the Subject", "This is the >>> > message > >>>> body"); >>>> ?> >>>> >>>> when i load the page, i get the following: >>>> >>>> Warning: Server Error in C:\inetpub\wwwroot/php/tests/test.php on line >>> > 2 > >>>> test.php being the file containing the PHP mail code >>>> >>>> this is the sendmail info in my php.ini file: >>>> >>>> [mail function] >>>> ; For Win32 only. >>>> SMTP = localhost ; for Win32 only >>>> >>>> ; For Win32 only. >>>> sendmail_from = [EMAIL PROTECTED] ; for Win32 only >>>> >>>> >>>> thanks, >>>> >>>> pete >>> >>> >>> -- >>> >>> Michael Kelley >>> [EMAIL PROTECTED] >>> >>> Programmer/Systems Analyst I >>> New Mexico State University >>> Information and Communication Technologies >>> Work # (505)-646-1374 >>> P.O. Box 30001 >>> MSC: 3AT >>> Las Cruces, NM 88003 >>> >>> >>> >>> >>> >>> >>> -- >>> PHP Windows Mailing List (http://www.php.net/) >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> To contact the list administrators, e-mail: [EMAIL PROTECTED] >>> >>> >> >> >> -- >> PHP Windows Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: [EMAIL PROTECTED] >> >> -- Michael Kelley [EMAIL PROTECTED] Programmer/Systems Analyst I New Mexico State University Information and Communication Technologies Work # (505)-646-1374 P.O. Box 30001 MSC: 3AT Las Cruces, NM 88003
Hi, As Rechard pointed out that mail() function accepts "additional_headers" as its 4th parameter. I usually add the following headers in that parameter: From: <users-address> \r\n Content-Type: text/plain; charset=iso-8859-1 \r\n Date: <date-you-must-build> \r\n optionally, you might also add Errors-to: <usually-admin-of-this-script> A couple of notes : 1) Date: field mail() on NT (sendmail.c) will add one if not given, but its GMT offset is wrong (as of 4.0.5RC1). so build it by yourself. $utcoff = (date("Z") / 60 / 60) * 100; $utcoff = sprintf("%05d", $utcoff); $mdate = date("D, d M Y H:i:s")." " . $utcoff; //$mdate = date("r"); 2) it is important to use "Errors-to:" as opposed to "Errors-To:" (notice case) to work around a bug in mail() on NT. Masato ----- Original Message ----- From: "Marnix Ottens" <[EMAIL PROTECTED]> To: "Richard" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, June 23, 2001 7:38 AM Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > Thanks for your reply Richard, but what I meant is > how to change the sender's address in the header, not in the message itself. > > As I don't host my own server I cannot change the php.ini file to replace > [EMAIL PROTECTED] > > Marnix > > ----- Original Message ----- > From: "Richard" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Saturday, June 23, 2001 6:20 PM > Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > > > > Sure, you can send it as a header after the body...Like so: > > > > $mailheaders = "From: $mailfrom\n"; > > mail($mailto, $mailsubject, $mailbody, $mailheaders); > > > > Where you establish $mailfrom as who its from > > > > Rick > > > > ----- Original Message ----- > > From: "Marnix Ottens" <[EMAIL PROTECTED]> > > To: "Michael Kelley" <[EMAIL PROTECTED]>; "Peter Haywood" > > <[EMAIL PROTECTED]> > > Cc: <[EMAIL PROTECTED]> > > Sent: Saturday, June 23, 2001 2:14 AM > > Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > > > > > > > Just a quick addon question regarding the mail() function. My mail form > > > works fine but the person who receives the e-mail is seeing > "unprivileged > > > user" as the sender's name. I assume this is displayed by default. > > > > > > Can I add a "from" field in the mail() function to display another name > > than > > > "unprivileged user"?? > > > > > > My current mail() looks like this: > > > mail ($recipient_email,$subject,$bodymessage); > > > > > > regards, > > > Marnix > > > > > > ----- Original Message ----- > > > From: "Michael Kelley" <[EMAIL PROTECTED]> > > > To: "Peter Haywood" <[EMAIL PROTECTED]> > > > Cc: <[EMAIL PROTECTED]> > > > Sent: Saturday, June 23, 2001 1:23 AM > > > Subject: Re: [PHP-WIN] using the PHP4 mail() function in (Newbie) > > > > > > > > > > You need to change > > > > SMTP = localhost ; for Win32 only > > > > to > > > > SMTP = MyMailhost.domain.edu ; for Win32 only > > > > > > > > (MyMailHost being your mail service's server -> pop3.hotmail.com) > > > > If you don't have that then you may need to install a mail service of > > > > your own ... > > > > If you need to do that research the archieves I know I've seen a load > of > > > > different free mail services and how to install (I didn't have to do > > > > that so I'm not going to try to tell you how to do it ...) > > > > > > > > > > > > Peter Haywood wrote: > > > > > > > > > Any advice on this would be much appreciated: > > > > > > > > > > I am trying to send a simple email. in the php file, i have > entered: > > > > > > > > > > <?php > > > > > mail ("[EMAIL PROTECTED]", "This is the Subject", "This is the > > message > > > > > body"); > > > > > ?> > > > > > > > > > > when i load the page, i get the following: > > > > > > > > > > Warning: Server Error in C:\inetpub\wwwroot/php/tests/test.php on > line > > 2 > > > > > test.php being the file containing the PHP mail code > > > > > > > > > > this is the sendmail info in my php.ini file: > > > > > > > > > > [mail function] > > > > > ; For Win32 only. > > > > > SMTP = localhost ; for Win32 only > > > > > > > > > > ; For Win32 only. > > > > > sendmail_from = [EMAIL PROTECTED] ; for Win32 only > > > > > > > > > > > > > > > thanks, > > > > > > > > > > pete > > > > > > > > > > > > -- > > > > > > > > Michael Kelley > > > > [EMAIL PROTECTED] > > > > > > > > Programmer/Systems Analyst I > > > > New Mexico State University > > > > Information and Communication Technologies > > > > Work # (505)-646-1374 > > > > P.O. Box 30001 > > > > MSC: 3AT > > > > Las Cruces, NM 88003 > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > PHP Windows Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Group My situation here is: NT 4, with Netscape SuiteSpot web server running 128 Bit SSL with are located behind a firewall, with only port 443 open to traffic Is it possible to use PHP, and connect to a database for dynamic content with only port 443 open? thanks Martin Tengowski working with a government site
Hi, I'm trying out various programs with PHP and am now on the topic of CSV files. My program contained minor errors which were soon fixed (the path of the DBA extension, etc.) But now I have this new error that I can't seem to solve. The statement in question is $i = dba_open($dbpath, "w", $dbtype); // $dbtype = "db2" I get the error, Warning: no such handler: db2 in F:\PHPSTUFF\Adbook.php on line 6 Changing the value of $dbtype from "db2" to "dba", "gdbm", etc. all result in the same kind of error for each type!. Am i missing something here? Do I have to install any modules that i'm not aware of. I was under the impression that php supported these types internally. One more thing ... what's the difference between dba_open() and dbmopen(), dba_fetch(), dbmfetch() etc thanks. RJ
So far only Microsoft Visual C++ is supported. - Frank > Hi all! > > Wich compiler (possibly free) can I use to compile PHP under Windows? > > Thanx! > > Bye > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > >
www.oosha.com/phpdev/index.php3 Ive had some great response to the site but not as much as id hoped if you have any ideas please email them to me and ill implement them -- [EMAIL PROTECTED] [EMAIL PROTECTED]
I sucessfully installed the cygwin version of postgres on Windows ME (using latest version of cygwin distro). I can connect to the postgres server and create databases using psql. I am now trying to connect to it from PHP. I downloaded the latest development snapshot from php4win (php-4.0.7-dev). I am running php as a module on my windows platform using a recent version of Apache as the HTTP server. I configured the relevant extension info in my php.ini extension_dir = c:/php-4.0.7/extensions/ extension=php_pgsql.dll I copied all the dlls in the dll directory to my windows/system folder. I cannot connect to my running postgres server. I lauched postgres with the following command: /usr/share/postmaster -i -h 127.0.0.1 -D /usr/share/postgresql/data Test script: <?php $dbconn = pg_connect("host=127.0.0.1 host=5432 dbname=mydb"); ?> Gives me this error: Warning: Unable to connect to PostgreSQL server: connectDBStart() -- unknown hostname: 127.0.0.1 in c:\apache\htdocs\pg.php on line 2 Any ideas on what I might do to fix the error? Also, has anybody gotten Postgres and PHP to work together on a Windows ME setup (or win 98, 95?)? Regards, Paul