0

Someone help me on how to send sms using mail function this is my php code:

   <?php
   $to = "xxxxxxxxxxx@smart.mms.ph";
   $from = "xxxxxxxx@gmail.com";
   $message = "sample";
   $header = "From: $from\n";
   mail($to,'',$message,$header);
   ?> 

after i test the code i got some error: Says: Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\sample-sms\send.php on line 6

i also put my email in mail function in my php.ini

      SMTP=localhost
      smtp_port=25
      sendmail_from = xxxxxxxx@gmail.com
Leonard
  • 19
  • 8

0 Answers0