The PHP Mailer library on Github is a wrapper over the built-in mail function but adds support for attachments and also integrates with SMTP so you can send mail without having a local mail server. This script lets you send messages via your Google’s Gmail server.
For example, we cannot send attachments using PHP’s mail(). In this tutorial, let’s use PHPMailer class for sending emails by using Gmail SMTP server. This library is popular because of its advanced features.
$from = "[email protected]"; $headers = "From:" . $from; echo mail ("[email protected]" ,"testmailfunction" , "Oj",$headers); I have trouble sending email in PHP. I get an error: SMTP server response: 530 SMTP authentication is required.