public function drupalSendsMail(TableNode $fields)
    {
        $mail = [
        'body' => $this->getRandom()->name(255),
        'subject' => $this->getRandom()->name(20),
        'to' => $this->getRandom()->name(10) . '@anonexample.com',
        'langcode' => '',
        ];
        foreach ($fields->getRowsHash() as $field => $value) {
            $mail[$field] = $value;
        }
        $this->getDriver()->sendMail($mail['body'], $mail['subject'], $mail['to'], $mail['langcode']);
    }
public function drupalSendsMail(TableNode $fields)
    {
        $mail = [
        'body' => $this->getRandom()->name(255),
        'subject' => $this->getRandom()->name(20),
        'to' => $this->getRandom()->name(10) . '@anonexample.com',
        'langcode' => '',
        ];
        foreach ($fields->getRowsHash() as $field => $value) {
            $mail[$field] = $value;
        }
        $this->getDriver()->sendMail($mail['body'], $mail['subject'], $mail['to'], $mail['langcode']);
    }
public function drupalSendsMail ( TableNode $ fields ) { $ mail = [ 'body' => $ this -> getRandom ( ) -> name ( 255 ) , 'subject' => $ this -> getRandom ( ) -> name ( 20 ) , 'to' => $ this -> getRandom ( ) -> name ( 10 ) . '@anonexample.com' , 'langcode' => '' , ] ; foreach ( $ fields -> getRowsHash ( ) as $ field => $ value ) { $ mail [ $ field ] = $ value ; } $ this -> getDriver ( ) -> sendMail ( $ mail [ 'body' ] , $ mail [ 'subject' ] , $ mail [ 'to' ] , $ mail [ 'langcode' ] ) ; }
This is mainly useful for testing this context.

@When Drupal sends a/an (e)mail:
This is mainly useful for testing this context .