To use the php mail() function, use the following syntax: 

mail(to,subject,message,headers,parameters);

  • to: This is required and says who will be receiving the email
  • subject: This is required and specifies the subject of the email
  • message: This is required and gives the message to be sent, with a maximum of 70 characters
  • headers: This is optional and includes fields such as from, cc, and bcc.
  • parameters: This is optional and includes any additional information

If this is your first time setting up php mail() function, we recommend reading the official documentation on using this code as it also includes examples.

Did you find this article helpful?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

The Community Support team wrote the article you're looking at now. We like to think it's perfect, but we're sure you have some suggestions. Please, let us know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Support Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.