Your question is not clear, but here is the simplest use of the mail function:
// The message $message = "Line 1\nLine 2\nLine 3"; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail(' caffeinated@example.com ', 'My Subject', $message);
See the docs for more details.
Note:
There are problems using the mail function:
- Email may be considered spam.
SMTP socket issued for each mail- Cannot be used for bulk email
- Insecure use of new line symbol in records
Best alternatives:
You should, if you can use PHPMailer
Or:
Swiftmailer
source share