Mail () function friving me crazy with the errors :@
-
hello , i have been trying to sort this out for hours , and there are probably 2000 other people who have asked this but when i try and send form results to an email adress from the local host which i set up i get this : Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Apache2.2\htdocs\websites\test\process.php on line 6 here is my code in php.ini
[mail function]
STMP = localhost
sendmail_from = me@whatever.comhere is my code in the form process.php
<?php
$name = $_REQUEST['name'];
$message = $_REQUEST['msg'];mail('me@whatever.com', $message,$name);
?>
i have also downloaded a SMTP piece of software to try and overcome the problem but no result yet ... Thnaks for all your help :P
-
hello , i have been trying to sort this out for hours , and there are probably 2000 other people who have asked this but when i try and send form results to an email adress from the local host which i set up i get this : Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Apache2.2\htdocs\websites\test\process.php on line 6 here is my code in php.ini
[mail function]
STMP = localhost
sendmail_from = me@whatever.comhere is my code in the form process.php
<?php
$name = $_REQUEST['name'];
$message = $_REQUEST['msg'];mail('me@whatever.com', $message,$name);
?>
i have also downloaded a SMTP piece of software to try and overcome the problem but no result yet ... Thnaks for all your help :P
You need to add a custom header as a fourth parameter to the
mail
function, to add your From header. Example:mail('me@whatever.com', $message, $name, 'From: webmaster@example.com' . "\r\n");
Adam Maras | Software Developer Microsoft Certified Professional Developer
-
You need to add a custom header as a fourth parameter to the
mail
function, to add your From header. Example:mail('me@whatever.com', $message, $name, 'From: webmaster@example.com' . "\r\n");
Adam Maras | Software Developer Microsoft Certified Professional Developer
Thanks that worked perfectly , by any chance do you know how i can fix this error ?
It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting
or the date_default_timezone_set() function. In case you used any of those methods and you are stillgetting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '0.0/no DST'
instead in C:\Apache2.2\htdocs\websites\test\process.php on line 6Thanks again
-
Thanks that worked perfectly , by any chance do you know how i can fix this error ?
It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting
or the date_default_timezone_set() function. In case you used any of those methods and you are stillgetting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '0.0/no DST'
instead in C:\Apache2.2\htdocs\websites\test\process.php on line 6Thanks again
You shouldn't rely on the default timezone of the server. It needs to be explicitly set to the required timezone. Eg:
date_default_timezone_set( 'Europe/London' ); // Or the timezone of your choice.
So put that line before line 6, process.php.
If at first you don't succeed, you're not Chuck Norris.
-
You shouldn't rely on the default timezone of the server. It needs to be explicitly set to the required timezone. Eg:
date_default_timezone_set( 'Europe/London' ); // Or the timezone of your choice.
So put that line before line 6, process.php.
If at first you don't succeed, you're not Chuck Norris.