Ryltar
12-22-2004, 10:00 PM
Hi, ok I get how to use the mail function, but everytime I try to use it I get this:
Warning: mail(): Failed to connect to mailserver at "'smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\web\APEX Platform Web Site\platform\feedback.php on line 74
line 74 is the if (!mail... line
I use this for the mail sending
ini_set ( sendmail_from, "bob@gmail.com" );
ini_set( SMTP, "'smtp.gmail.com" );
ini_set( smtp_port, 465 );
$to = "bob@hworld.com"; // Mail notification to this address
$subject = "New Feedback";
$message = "";
$message .= "This message has been automatically generated by " . $_SERVER['PHP_SELF'] . "\n";
$message .= "\n";
$message .= "There is a new feedback entry on the APEX Platform Website.\n";
$message .= "Go to feedback_results.php to read it.\n";
$message .= "If you have forgotten the password, please email $admin at $admin_email.\n";
$headers = "From: $admin_email\r\n";
if (!mail($to, $subject, $message, $headers)) echo "Error. Could not notify recipient of new feedback. Response may be delayed.<br />\n";
So I know that gmail won't work. I tried with localhost as well and that won't work. So what I am wondering, is there a way for me to set up a mail server on my PC or does someone know of a mailserver that would work for my purposes
--------
PS
This is running off of an Apache server on my PC.
Warning: mail(): Failed to connect to mailserver at "'smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\web\APEX Platform Web Site\platform\feedback.php on line 74
line 74 is the if (!mail... line
I use this for the mail sending
ini_set ( sendmail_from, "bob@gmail.com" );
ini_set( SMTP, "'smtp.gmail.com" );
ini_set( smtp_port, 465 );
$to = "bob@hworld.com"; // Mail notification to this address
$subject = "New Feedback";
$message = "";
$message .= "This message has been automatically generated by " . $_SERVER['PHP_SELF'] . "\n";
$message .= "\n";
$message .= "There is a new feedback entry on the APEX Platform Website.\n";
$message .= "Go to feedback_results.php to read it.\n";
$message .= "If you have forgotten the password, please email $admin at $admin_email.\n";
$headers = "From: $admin_email\r\n";
if (!mail($to, $subject, $message, $headers)) echo "Error. Could not notify recipient of new feedback. Response may be delayed.<br />\n";
So I know that gmail won't work. I tried with localhost as well and that won't work. So what I am wondering, is there a way for me to set up a mail server on my PC or does someone know of a mailserver that would work for my purposes
--------
PS
This is running off of an Apache server on my PC.