RE: mail function

From: Date: Mon, 28 Aug 2000 12:21:54 +0000
Subject: RE: mail function
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2208@lists.php.net to get a copy of this message
Hi there, I'm new to PHP and I had the same kind of problems with mailto() and yes I'm going through a proxy server and firewall. To test your code for correct functionality connect directly to the Internet from your development machine via modem. This removes the proxy server from the equation. Launch your normal email client (Outlook, etc) and ensure you can send and receive email. If this works then your email settings are correct. Next make sure your SMTP setting in PHP.INI is the same as in your email client. Then try your PHP code. An email should be generated and sent without errors. If this is the case then it means there is a problem between your PHP code and Proxy server. This was my case and I had to change my proxy/firewall settings. Originally I was getting the same error message as you but I changed (lowered) my security settings and established a "Transparent Proxy" and now the same code works just fine. I'm running WinProxy 3 on a Win 95 machine as my proxy/firewall. Here is the PHP code I use: $to = "$toname <$toemail>"; $from = "$fromname <$fromemail>"; $subject = "Your Subject"; $message = "Your Message"; mail($to, "$subject", $message, "From: $from"); Hope this helps James -----Original Message----- From: Sreekumar [mailto:sreekumarp@yahoo.com] Sent: 28 August 2000 07:28 To: php-windows@lists.php.net Subject: mail function Hi, I am using PHP4 under 1. Windows'98,Personnel web server for windows 2. Windows NT 4 and IIS4 When i used the mail function ~~~~~~~~~ mail("sreekumarp@yahoo.com","subject","body","sreekumarp@yahoo.com"); ~~~~~~~~~ It shows an error ~~~~~~~~~ Warning: Failed to Connect in C:\phpprojects\echo.php on line 3 ~~~~~~~~~ Why is this so, i have changed the mail section in PHP.ini [mail function] SMTP = smtp.mail.yahoo.com ;for win32 only sendmail_from = sreekumarp@yahoo.com ;for win32 only Can any one help me for the above. 2. How can one test MAIL function while internet access is through a web proxy Thank you in advance Sreekumar __________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/

« previous php.windows (#2208) next »