Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2004, 01:41 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default mail() is not sending email on localhost SMTP

i always get this error when i use
<?php
mail("joecool@example.com", "My Subject", "Line 1\nLine 2\nLine 3");
?>

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\inetpub\wwwroot\misc\mail.php on line 2

i can't get email from locahost SMTP to my account at mail.mydomain.com

php.ini configuration:
SMTP = localhost
sendmail_from = me@localhost.com

SMTP service is running on Windows 2003 IIS; connected to dial-up; windows logon is Administrator/two

anyone there2quickly troubleshoot ? please help
__________________
`~@#\^%&*/\.<.\/-|+|_!:;..=?>
PHP, SEO | anshul shrivastava | mediasworks.org | FB
 
Old August 4th, 2004, 02:00 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Dear anshul Would you like to tel me that how you configure PHP on IIS ?
And as for as the SMTP is concern you can check it in adminsitrator tools

Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
 
Old August 4th, 2004, 02:16 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

we are using php 4.3.2 on windows 2003 server.
i see 'FastCGI Enabled' message on top of phpinfo() page

server API CGI/FastCGI ( this i see in o/p of phpinfo() )
all files of php engine r in c:\php4folder 'c:\php4' also contains a folder nanmed 'php'
we've a php.ini file in C:/windows

is it not possible to send mail from localhost 2 other domain

is this information sufficient?
please answer.
 
Old August 4th, 2004, 02:24 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Dear you can send information to any one from your local host. I can say this because I used it in ASP in IIS.

But as the PHP is concern I used Apache web server

Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
 
Old August 4th, 2004, 06:38 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

with few modifications, i m getting error:

Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for xyz@somedomain.com in c:\inetpub\wwwroot\misc\mail.php on line 2

code of file:
<?php
mail("xyz@somedomain.com", "My Subject", "Line 1\nLine 2\nLine 3");
?>
 
Old August 4th, 2004, 06:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does your target server have mail relaying enabled? Usually it wouldn't, for security reasons, unles the serevr admin knows you want to use mail relay. If you have authentication for relaying mail, then an intervening firewall or router may be blocking it. Since you seem to be running Windows kit, you might want to have a look at this article for Exchange Server users:

http://support.microsoft.com/default...;en-us;q295164

HTH
Dan





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem sending email with SMTP in VB.Net Compiler Forum and Wrox.com Feedback 3 November 30th, 2007 07:25 PM
sending email with SMTP authentication (port 26) crmpicco PHP How-To 3 November 4th, 2007 01:18 PM
Sending email problem - SMTP server response: 554 Havokx Beginning PHP 0 July 27th, 2007 04:04 AM
Problem sending SMTP mail Dsypher ASP.NET 2.0 Basics 3 February 16th, 2006 01:58 PM
Sending EMail thru SMTP server in C# - Most of the peri C# 1 December 20th, 2004 09:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.