title: How to send an e-mail after adding the product to the cart in magento 2?
body: <p>Unfortunately, so far I am a complete beginner in creating a module in magento.
  I need to send an email after adding the item to the cart.</p>
  <p>As I understand it, I need to use the checkout_cart_product_add_after event</p>
  <p>I created some files, but I don't understand how to send an email after adding the item to the cart</p>
  <p>My/Module/etc/events.xml</p>
  <pre><code>&lt;config xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:Event/etc/events.xsd&quot;&gt;
  &lt;event name=&quot;checkout_cart_product_add_after&quot;&gt;
      &lt;observer name=&quot;email_after_adding_product&quot; instance=&quot;My\Module\Observer\SendEmailForCart&quot;/&gt;
  &lt;/event&gt;
  </code></pre>
  
  <p>My/Module/Observer/SendEmailForCart.php</p>
  <pre><code>&lt;?php
  namespace My\Module\Observer;
  
  use Magento\Framework\Event\ObserverInterface;
  use My\Module\Helper\Email;
  
  class SendEmailForCart implements ObserverInterface
  {
      private $helperEmail;
  
      public function __construct(
          Email $helperEmail
      ) {
          $this-&gt;helperEmail = $helperEmail;
      }
      public function execute(\Magento\Framework\Event\Observer $observer)
      {
          return $this-&gt;helperEmail-&gt;sendEmail();
      }
  }
  </code></pre>
  <p>My/Module/Helper/Email.php</p>
  <pre><code>&lt;?php
  
  namespace My\Module\Helper;
  
  class Email extends \Magento\Framework\App\Helper\AbstractHelper
  {
  
      public function __construct(
  
      )
      {
  
      }
  
      public function sendEmail()
      {
          try {
              
          } catch (\Exception $e) {
  
          }
      }
  }
  </code></pre>
  <p>Please tell, what code I need to write in the Email.php file?
  And do I need to create any additional files or modify the ones I showed above?</p>