Re: How to send e-mail from within PHP in a M$ platform?

From: Date: Wed, 06 Sep 2000 09:22:47 +0000
Subject: Re: How to send e-mail from within PHP in a M$ platform?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-15478@lists.php.net to get a copy of this message
Hello Paulo, On 05-Sep-00 13:03:18, you wrote: >I still have to fine tune some things though. In case you want to have a look > at our current configuration at this ISP, I am sending you the address as Are you? Where? >well. As you can see, my ISP upgraded to PHP4 but did not even take the care >to set directive include_path correctly, it is currently unset. >So if you don't mind trying to answer me these other questions, here they go: >1) In your SMTP class, when defining the information for the recently created > instance you use the following code: >$smtp->host_name=getenv("HOSTNAME"); >$smtp->localhost="localhost"; >$from=getenv("USER")."@".$smtp->host_name; >No matter what, but both getenv("HOSTNAME") as well as getenv("USER") return > >empty strings to me (they aren't defined). >So I am using $SERVER_NAME in place of getenv("HOSTNAME") and I am forcing >variable $from to be a specific address always. >I could only find server variables HTTP_HOST and SERVER_NAME as substitutes >for HOSTNAME. And regarding USER: it is currently unset in my ISP NT >installation, but does it make sense to have this variable in NT? I could >check for its existance in a PHP 3.0.16 UNIX installation. Well that is just an example. I used those variables so you don't have to change the example script to try the class. I guess those only work on Unix machines, so you need to replace them with something that makes sense. host_name is the address of the SMTP server. localhost should be the address of your machine but usually is irrelevant. from is you address as sender. Bounced messages will return to that address regardless what you put in the From: message header. SMTP does not care about what you put in the headers. >2) Regarding 'include_path': since it is not set, instead of issuing commands > like include("file.php") I now have to issue commands like include >("d:\inetpub\ftproot\some_isp_directory\my_directory\file.php"). This command > works, but when I call something like include >("http://www.my_domain.com/my_file.php"), php reports >the following error: > >Warning: Failed opening >'http://www.mydomain.com/my_file.php' for inclusion >(include_path='') in >D:\Inetpub\ftproot\some_isp_directory\my_directory\parent_file.php on line >193 >Is this because 'include_path' is unset or at least not set to './' ? No, AFAIK include paths only apply to files in your local file system. >3) Regarding the setting of PHP directives like we can do with >Apache .htaccess files. Do you know how we can (and *if* we can) do local >settings under IIS? Nothing about that is said in the PHP docs, so I presume No, .htacess is a Apache thing. >the only settings you would have on a NT machine running IIS would be in >PHP.INI, and those would then be the values for all sub-hosted virtual >domains on the machine and I, as a user, do not have access to PHP.INI... Is >this really the case? Or could I somehow redefine locally, even if on a >script by script basis these PHP directives? If so, do you know the correct >sintax? If I am not mistaken you can set any configuration directives at the top of your script. Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org -- E-mail: mlemos@acm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --

« previous php.general (#15478) next »