Explain mail function in PHP with syntax?

devquora
devquora

Posted On: Feb 22, 2018

 

The mail function is used in PHP to send emails directly from script or website. It takes five parameters as an argument.

Syntax of mail (): mail (to, subject, message, headers, parameters);

  • to refers to the receiver of the email
  • Subject refers to the subject of an email
  • the message defines the content to be sent where each line separated with /n and also one line can't exceed 70 characters.
  • Headers refer to additional information like from, Cc, Bcc. These are optional.
  • Parameters refer to an additional parameter to the send mail program. It is also optional

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    PHP Interview Questions

    What is T_PAAMAYIM_NEKUDOTAYIM in PHP?

    T_PAAMAYIM_NEKUDOTAYIM is scope resolution operator used as :: (double colon) .Basically, it used to call static methods/variables of a Class...

    PHP Interview Questions

    What is the difference between == and === operator in PHP ?

    In PHP == is equal operator and returns TRUE if $a is equal to $b after type juggling and === is Identical operator and return TRUE if $a is equal to $b, and they are of the same data type...