Guest User

Untitled

a guest
Jul 22nd, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2.  
  3. class emailToSms
  4. {
  5. private $idToAddress = array( 1 => 'messaging.att.net');
  6. private $myEmail = 'xxxxxx@gmail.com';
  7. function __contstruct($carrierId)
  8. {
  9. $this->to = $idToAdress[$this->scarrierId];
  10. }
  11. function sendSms($number, $subject, $message)
  12. {
  13. $headers="From: ".$this->myEmail."\r\n";
  14. $recipient = $number. "@" . $this->to;
  15. mail($recipient, $subject, $message, $headers);
  16. }
  17. }
  18.  
  19. // Usage example
  20. $e= new emailToSms(1);
  21. $e->sendSms("904809843", "YO","Hey!");
  22. ?>
Add Comment
Please, Sign In to add comment