Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the function calls “mail()” and “@mail()”?

I am writing a PHP mail function and some examples have @mail(…) and others have just mail(…).

What is the difference and which one is best to use?

Cheers

like image 276
Designer023 Avatar asked Sep 16 '10 08:09

Designer023


1 Answers

@ supresses all warnings/errors, which mail() function may throw.

It is not good practice to use "@", because you never know if something doesn't work and also it hits the performance of you PHP application too!

like image 53
Laimoncijus Avatar answered Nov 11 '22 10:11

Laimoncijus