Can not access laravel object 5.3


I am using laravle 5.3 mailables for sending emails.I want to pass data to view via with method.

I have create a mailable MytestMail.php


namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class MytestMail extends Mailable {
    public $dataArray;
    use Queueable,

     * Create a new message instance.
     * @return void
    public function __construct($dataArray) {
        $this->dataArray= $dataArray;


     * Build the message.
     * @return $this
    public function build() {

        $address = '[email protected]';
        $name = 'asasa';
        $subject = 'sasasasub';

        return $this->view('emails.myTestMail')
                ->from($address, $name)
                ->cc($address, $name)
                ->bcc($address, $name)
                ->replyTo($address, $name)
                        'name' => $this->dataArray->name,
                        'password' => $this->dataArray->password,
                        'E_id' => $this->dataArray->E_id,
                        'email' => $this->dataArray->email,



Now i get an error

Trying to get property of non-object

When i print_r $this->dataArray i got an array with values

Array ( [name] => sdsdsds [E_id] => 0123 [password] => sdsd [username]
=> [email protected] )

Please help me...Why i get this error message?

When you print_r it tells you the data type which is ->Array<- ( [name] => sdsdsds [E_id] => 0123 [password] => sdsd [username]=> [email protected] ), So when accessing the variable $dataArray be sure to access it as an array like so $this->dataArray['name'] or $this->dataArray['password'] etc...