[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/composer/vendor/swiftmailer/swiftmailer/doc/ -> introduction.rst (source)

   1  Introduction
   2  ============
   3  
   4  Swift Mailer is a for sending e-mails from PHP applications.
   5  
   6  System Requirements
   7  -------------------
   8  
   9  Swift Mailer requires PHP 7.0 or higher (``proc_*`` functions must be
  10  available).
  11  
  12  Swift Mailer does not work when used with function overloading as implemented
  13  by ``mbstring`` when ``mbstring.func_overload`` is set to ``2``.
  14  
  15  Installation
  16  ------------
  17  
  18  The recommended way to install Swiftmailer is via Composer:
  19  
  20  .. code-block:: bash
  21  
  22      $ composer require "swiftmailer/swiftmailer:^6.0"
  23  
  24  Basic Usage
  25  -----------
  26  
  27  Here is the simplest way to send emails with Swift Mailer::
  28  
  29      require_once '/path/to/vendor/autoload.php';
  30  
  31      // Create the Transport
  32      $transport = (new Swift_SmtpTransport('smtp.example.org', 25))
  33        ->setUsername('your username')
  34        ->setPassword('your password')
  35      ;
  36  
  37      // Create the Mailer using your created Transport
  38      $mailer = new Swift_Mailer($transport);
  39  
  40      // Create a message
  41      $message = (new Swift_Message('Wonderful Subject'))
  42        ->setFrom(['john@doe.com' => 'John Doe'])
  43        ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name'])
  44        ->setBody('Here is the message itself')
  45        ;
  46  
  47      // Send the message
  48      $result = $mailer->send($message);
  49  
  50  You can also use Sendmail as a transport::
  51  
  52      // Sendmail
  53      $transport = new Swift_SendmailTransport('/usr/sbin/sendmail -bs');
  54  
  55  Getting Help
  56  ------------
  57  
  58  For general support, use `Stack Overflow <https://stackoverflow.com>`_.
  59  
  60  For bug reports and feature requests, create a new ticket in `GitHub
  61  <https://github.com/swiftmailer/swiftmailer/issues>`_.


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1