title: Laravel Call to a member function send() on a non-object
body: <p>I am trying to send a mail using my laravel controller, a very simple mail which is sent in my localhost with no problems but once in server I get this error : </p>
  
  <pre><code>20170325T153701: /public/index.php 
  PHP Fatal error:  Call to a member function send() on a non-object in /public/index.php on line 56 
  PHP Fatal error:  Call to a member function send() on a non-object in /vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 107 
  </code></pre>
  
  <p>The browser only shows a 500 error, the error is only seen in my error log. Here is the code used to send the mail</p>
  
  <pre><code>    use Illuminate\Support\Facades\Mail; // just to say I'm calling it
      $v_code = str_random(30);
      $mail_content = array('code' =&gt; $v_code);
  
  
      $user = User::create([
          'name' =&gt; $data['name'],
          'email' =&gt; $data['email'],
          'password' =&gt; bcrypt($data['pass']),
      ]);
  
      if ($user) {
          Mail::send('User::mail.verifyMail', $mail_content, function ($message) use ($data) {
              $message-&gt;to($data['email'], $data['name'])
                  -&gt;subject('Verify your email address');
          });
  </code></pre>