Skip to content
Simple PHP class for sending emails including amp4email version.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
LICENSE
README.md

README.md

PHPmail4AMP


  require './phpmail4amp.php';

  $ampmail = new PHPmail4AMP;
  
  $ampmail->sendFrom('sender@example.com', 'Sender name');
  $ampmail->sendTo('recipient@example.com', 'Recipient Name');
  //$ampmail->sendCC('emailaddress@example.com');
  //$ampmail->sendBCC('emailaddress@example.com');
  //$ampmail->replyTo('emailaddress@example.com');
  
  $ampmail->subject   = 'Email with AMP version';
  $ampmail->mailText  = 'Hello world in Text!';
  $ampmail->mailHTML  = 'Helo world in <strong>HTML</strong>!';
  $ampmail->mailAMP   = '<!doctype html>
      <html amp4email>
      <head>
        <meta charset="utf-8">
        <style amp4email-boilerplate>body{visibility:hidden}</style>
        <script async src="https://cdn.ampproject.org/v0.js"></script>
      </head>
      <body>
        Hello world in AMP!
      </body>
    </html>';
    
  if($ampmail->send()) {
    // success
  } else {
    // failed
  }
You can’t perform that action at this time.