title: Laravel 8: Nexmo not sending code to mobile number country pakistan (Cannot send message without a sender address)
body: <p>I am using laravel 8. I want to send a notification SMS through nexmo when user register, but it doesn't work. It says Swift_TransportException Cannot send message without a sender address. I cannot find the solution for nexmo mobile. How to solve this problem in laravel 8.</p>
  <p><strong>UserController.php</strong></p>
  <pre><code>public function registerUser(Request $request)
  {
      if ($request-&gt;isMethod('post')) {
          $data = $request-&gt;all();
          // echo &quot;&lt;pre&gt;&quot;;
          // print_r($data);
          // die;
          //checking if user already register
          $userCount = User::where('email', $data['email'])-&gt;count();
          if ($userCount &gt; 0) {
              $message = &quot;Email Already Register&quot;;
              session::flash('error_message', $message);
              return redirect()-&gt;back();
          } else {
              //Register new user
              $user = new User;
              $user-&gt;name = $data['name'];
              $user-&gt;mobile = $data['mobile'];
              $user-&gt;email = $data['email'];
              $user-&gt;password = bcrypt($data['password']);
              $user-&gt;status = 1;
              $user-&gt;save();
  
              if (Auth::attempt(['email' =&gt; $data['email'], 'password' =&gt; $data['password']])) {
                  // echo &quot;&lt;pre&gt;&quot;;
                  // print_r(Auth::user());
                  // die;
                  //update user cart with user id
                  if (!empty(Session::get('session_id'))) {
                      $user_id = Auth::user()-&gt;id;
                      $session_id = Session::get('session_id');
                      Cart::where('session_id', $session_id)-&gt;update(['user_id' =&gt; $user_id]);
                  }
  
                  Notification::send($user, new MailNotification);
                  return redirect('/');
              }
          }
      }
  }
  </code></pre>
  <p><strong>User Model</strong></p>
  <pre><code> &lt;?php
  
  namespace App;
  
  use Illuminate\Contracts\Auth\MustVerifyEmail;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  use Illuminate\Notifications\Notifiable;
  
  class User extends Authenticatable
  {
      use Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name', 'email', 'password',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  
      /**
       * The attributes that should be cast to native types.
       *
       * @var array
       */
      protected $casts = [
          'email_verified_at' =&gt; 'datetime',
      ];
  
      public function routeNotificationForNexmo($notification)
      {
          return $this-&gt;mobile;
      }
  }
  </code></pre>
  <p><strong>MailNotification.php</strong></p>
  <pre><code>    &lt;?php
  
  namespace App\Notifications;
  
  use Illuminate\Bus\Queueable;
  use Illuminate\Contracts\Queue\ShouldQueue;
  use Illuminate\Notifications\Messages\MailMessage;
  use Illuminate\Notifications\Notification;
  use Illuminate\Notifications\Messages\NexmoMessage;
  
  class MailNotification extends Notification
  {
      use Queueable;
  
      /**
       * Create a new notification instance.
       *
       * @return void
       */
      public function __construct()
      {
          //
      }
  
      /**
       * Get the notification's delivery channels.
       *
       * @param  mixed  $notifiable
       * @return array
       */
      public function via($notifiable)
      {
          return ['mail', 'nexmo'];
      }
  
      /**
       * Get the mail representation of the notification.
       *
       * @param  mixed  $notifiable
       * @return \Illuminate\Notifications\Messages\MailMessage
       */
      public function toMail($notifiable)
      {
          return (new MailMessage)
              -&gt;line('The introduction to the notification.')
              -&gt;action('Notification Action', url('/'))
              -&gt;line('Thank you for using our application!');
      }
  
      /**
       * Get the array representation of the notification.
       *
       * @param  mixed  $notifiable
       * @return array
       */
      public function toNexmo($notifiable)
      {
          return (new NexmoMessage)
              -&gt;content('Dear Customer, You have been registered successfully registered with stylooworld.com. Login to your account to access orders and available offers');
      }
  }
  </code></pre>
  <p><em>service.yml</em></p>
  <pre><code>    &lt;?php
  
  return [
  
      'mailgun' =&gt; [
          'domain' =&gt; env('MAILGUN_DOMAIN'),
          'secret' =&gt; env('MAILGUN_SECRET'),
          'endpoint' =&gt; env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
      ],
  
      'postmark' =&gt; [
          'token' =&gt; env('POSTMARK_TOKEN'),
      ],
  
      'ses' =&gt; [
          'key' =&gt; env('AWS_ACCESS_KEY_ID'),
          'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),
          'region' =&gt; env('AWS_DEFAULT_REGION', 'us-east-1'),
      ],
  
      'nexmo' =&gt; [
  
          'sms_from' =&gt; '03025496045',
      ],
  ];
  </code></pre>