next Posted April 13, 2008 Share Posted April 13, 2008 Good morning, 1) I have the following code: function process_form($data) { $msg = "The form at {$_SERVER['PHP_SELF']} was submitted with these values:\r\n"; foreach($data as $key => $val) $msg .= "$key => $val \r\n"; mail('[email protected]', 'form submission test', $msg); } For some reason php return an error: Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\wamp\www\practice\forms_basics\form_validation.php on line 77 I changed php.ini and still get this error message and php docs don't show a custom FROM parameter in mail function, how do i fix this? My Php.ini: [mail function] ; For Win32 only. SMTP = smtp.gmail.com smtp_port = 465 ; For Win32 only. ;sendmail_from = [email protected] 2) <input type = "text" name = "first" value = "<?php echo @$method['first']; ?>" /> What is the purpose of '@' in @$method['first']; ? Thanks. Link to comment https://forums.phpfreaks.com/topic/100929-few-questions-mail-error-and-purpose-of/ Share on other sites More sharing options...
raku Posted April 13, 2008 Share Posted April 13, 2008 You add the "@" in front of a statement that you don't want it to report an error for. Not sure about php.ini and mail, I think it has to do with sendmail setup. Link to comment https://forums.phpfreaks.com/topic/100929-few-questions-mail-error-and-purpose-of/#findComment-516144 Share on other sites More sharing options...
next Posted April 13, 2008 Author Share Posted April 13, 2008 Thanks for explaining @. I feel stupid, i had sendmail_from commented out Link to comment https://forums.phpfreaks.com/topic/100929-few-questions-mail-error-and-purpose-of/#findComment-516209 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.