mail() function mails information to a given recipient. : mail « Utility Function « PHP






mail() function mails information to a given recipient.

 
Its syntax is: boolean mail(string recipient, string subject, string message [, string addl_headers])

<?
$email = "y@yourserver.com";
$subject = "This is the subject";
$message = "This is the message";
$headers = "From: somebody@somesite.com ";

mail($email, $subject, $message, $headers);
?>
  
  








Related examples in the same category

1.Add both name and address values into the email address
2.mail-javascript.php
3.Using mail() to redirect user information
4.Encrypting and Sending Secure Emails Using S/MIME
5.send-email-multiple-recipients-2.php
6.send-email-with-headers.php
7.send-mail-multiple-recipients.php
8.send-plaintext-email.php
9.Sending user-requested information
10.Sends a HTML mail from a given email address:
11.Sending Internet Mail
12.Sending Mail
13.Sending a message with mail()