Jump to content

few questions: mail() error and purpose of @


next

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.