How do I send email using the PHP mail() function?
If you want to send mail in your PHP code, you're likely to use the mail() PHP function. We have an important rule on our webhosting and reseller hosting servers you have to keep in mind when using the mail() PHP function.
Important to keep in mind
The email address you are using as sender email address has to be created in DirectAdmin as an email address. If you use an external mail service, you also have to create the email address there. In addition, you can only send email using a sender email address that matches the domain that is sending the email. This means that you can not use the PHP mail() function to send an email using 'firstname.lastname@example.org' as sender email address.