PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
SMTP server for mail() Posted by dbrandt on 3 Feb 2008 at 8:20 PM
I have this code:
<?php
$to = $_GET['to'];
$from = $_GET['from'];
$subject = $_GET['subject'];
$body = $_GET['body'];
$headers = "From: $from";

$to = explode( ", ", $to );

foreach ( $to as $SendTo )
{
	mail( $SendTo, $subject, $body, $headers );
	print( "Mailed to $SendTo<br />\n" );
}
?>


When I try and execute it, I get this error:

Warning: mail() [function.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:\wamp\www\scripts\mail.php on line 12


My INI file looks like this:

; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = jBrandt369@jComp.com


I thought that SMTP didn't need any extra software, but I guess it does.
Since Window's version of sendmail is overpriced garbage, what should I get, and how do I make it start automatically with Apache / PHP ?
Report
Re: SMTP server for mail() Posted by quotient on 12 Feb 2008 at 12:09 PM
If you have a professional version of Windows, you can use IIS as SMTP relay. You can also use your ISP mailserver, e.g.: mail.yourisp.com or smtp.yourisp.com.


Francis Lacroix
Web Developer
Check out OpenSource GPL&LGPL software at
http://www.quotient.ca.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.