Home  >  Article  >  Backend Development  >  php email related functions

php email related functions

伊谢尔伦
伊谢尔伦Original
2016-11-21 17:54:481170browse

mail() function allows you to send emails.

In order for the right-click function to run properly, PHP must access the sendmail executable file in your system during compilation. If you use other mail programs, such as qmail or postfix, make sure they use appropriate wrappers for sendmail. PHP will first look for sendmail in your PATH variable, and then look for it in the following path: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It is highly recommended to have sendmail in your PATH variable. Furthermore, the user running the compiled PHP program must also have permission to execute sendmail.

Related functions:

ezmlm_hash — Calculate the hash value required for EZMLM

mail — Send email

Usage example:

<?php
$Name = "Da Duder"; //senders name
$email = "email@adress.com"; //senders e-mail adress
$recipient = "PersonWhoGetsIt@emailadress.com"; //recipient
$mail_body = "The text for the mail..."; //mail body
$subject = "Subject for reviever"; //subject
$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
mail($recipient, $subject, $mail_body, $header); //mail command 
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn