title: Yii2 Send Verification to Email
body: <p>Anyone who know how to send verification to email after user success register their information on the system....i hope anyone can explain step by step....should i edit in this or have any solution or suggestion:</p>
  
  <pre><code>Yii::$app-&gt;mail-&gt;compose()
   -&gt;setFrom('somebody@domain.com')
   -&gt;setTo('myemail@yourserver.com')
   -&gt;setSubject('Email sent from Yii2-Swiftmailer')
   -&gt;send();
  </code></pre>
  
  <p>I already configure the swiftmailer like this:</p>
  
  <pre><code>'mail' =&gt; [
           'class' =&gt; 'yii\swiftmailer\Mailer',
           'transport' =&gt; [
               'class' =&gt; 'Swift_SmtpTransport',
               'host' =&gt; 'localhost',
               'username' =&gt; 'username',
               'password' =&gt; 'password',
               'port' =&gt; '587', 
               'encryption' =&gt; 'tls', 
           ],
  </code></pre>