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

From: Date: Tue, 05 Sep 2000 16:03:18 +0000
Subject: Re: How to send e-mail from within PHP in a M$ platform?
Groups: php.general 
Request: Send a blank email to php-general+get-15314@lists.php.net to get a copy of this message
Prezado Manuel, Thanks a lot for your information! I finally could send e-mails by making use of your classes. 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 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. 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 './' ? 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 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? Mais uma vez obrigado, Paulo Parola Manuel Lemos <mlemos@acm.org> said: > Hello Paulo, > > Apparently PHP mail() function is broken in the sense that it does not seem > to be handling SMTP multi-line responses. I can confirm if that is the problem > that makes it not work with your ISP SMTP server if you send me the server > address. > > It does not matter what that means now. What matters is that may needs > fixing. A bug report is in the way. > > While that does not happen you may want to try this PHP SMTP client class > that not only handles multi-line responses, it also supports ESMTP > PIPELINING extension if available on the SMTP server (usually it is) that > makes the delivery of messages to multiple recipents much more efficient. > > http://phpclasses.UpperDesign.com/browse.html/package/14 > > Use this until Windows PHP mail function gets fixed. > > 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 (#15314) next »