Strange error throws only in iphone 7+ and android 6

Permalink
Hello All
I'm developing a multi step sliding booking form along with sagepay payment. When the payment is done, the system goes to a success page and send email notification to the customer as well as admin. Its working absolutely fine for me in desktop. But few of my fellow buddies got the below issue while they are on iphone 7 plus (Safari) & Android 6 (Chrome).

I cannot understand how can a browser or device throw PHP error while others not. Its a very strange issue.
Zend\Mail\Message::addTo expects a string, AddressInterface, array, AddressList, or Traversable as its first argument; received "NULL"

In case if you wanna look at the email code
$mh = $this->app->make('mail');
$mh->from('donotreply@domain.com', 'Site Name');
$adminUser = UserInfo::getByID(USER_SUPER_ID);
if (is_object($adminUser)) {
   $mh->to($adminUser->getUserEmail(), 'Site Admin');
}
$mh->to($sagePay_array['custEmail'], $sagePay_array['custFname'].' '.$sagePay_array['custLname']);
$mh->addParameter('billing_name', $sagePay_array['custFname'].' '.$sagePay_array['custLname']);
$mh->addParameter('skip_type', $skip_type);
$mh->addParameter('skip_contents', $skip_contents);
$mh->addParameter('skip_cost', '£'.$sagePay_array['skip_total_cost']);
$mh->addParameter('skip_datetime', $sagePay_array['sbDeliveryDate'].' at '.$sagePay_array['sbDeliveryTime']);
$mh->addParameter('skip_address', $sagePay_array['sbDeliveryAddress1'].', '.$sagePay_array['sbDeliveryAddress2'].', '.$sagePay_array['sbDeliveryCity'].', '.$sagePay_array['sbDeliveryCounty'].' '.$sagePay_array['sbDeliveryPostcode']);
$mh->addParameter('siteName', tc('SiteName', $config->get('concrete.site')));
$mh->load('skip_booking_confirm', 'skip_booking');


Thanks

1 Attachment

ronyDdeveloper
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi ronyDdeveloper,

Have you tried the same steps using Chrome's mobile simulator (it changes the browser user agent string)?

Do you get errors if the phone is less than iPhone 7 and Android 6?
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
I've figured out the issue. The session cannot hold the email address for some reason in iphone 7+ & android 6. So it throws error while attempting to send email. But now I've used another way to send the email without session. And its all working okay.

Rony