$from, 'To' => $to, 'Subject' => $sub, 'Reply-To' => $from, 'X-Mailer' => "CM TLC", ); $smtp = Mail::factory('smtp', array( 'host' => 'ssl://smtphost', 'port' => '465', 'auth' => true, 'username' => '', //your gmail account 'password' => '' // your password )); // Send the mail $mail = $smtp->send($to, $headers, $msg); //check mail sent or not if (PEAR::isError($mail)) { return 0; } else { return 1; } } public function sendSMS($num, $msg) { // Hard-coded credentials $SnSclient = new SnsClient([ 'version' => 'latest', 'region' => 'eu-west-1', 'credentials' => [ 'key' => '', 'secret' => '', ], ]); //$topic = 'arn:aws:sns:us-east-1:111122223333:MyTopic'; try { $result = $SnSclient->publish([ "MessageAttributes" => [ 'AWS.SNS.SMS.SenderID' => [ 'DataType' => 'String', 'StringValue' => 'RUNIdP' ], 'AWS.SNS.SMS.SMSType' => [ 'DataType' => 'String', 'StringValue' => 'Transactional' ] ], 'Message' => $msg, 'PhoneNumber' => $num, ]); var_dump($result); } catch (AwsException $e) { // output error message if fails error_log($e->getMessage()); } } }