How to send SMS with PHP?

Sending SMS (Short Message Service) with PHP application is done for multiple purposes. For example, many security enhancements are integrating multi-factor authentication system where you can additionaly identify user by mobile device, retrieve forgotten passwords or similar. Other common usages are sending marketing messages, or notifing users about different events and similar.

Sending SMS via gateway

The diagram below explains a simplified SMS sending flow where PHP application communicates with a SMS gateway. Gateway converts and forwards received data to SMS center (SMSC). SMSC routes data to mobile device (end user).

Sending SMS with PHP

Most common and simple to integrate usage in PHP applications is using an SMS API.

Sending SMS via email carriers

Another, less common and less stable option to send SMS is using an email from particular carrier. SMS is sent by sending an email to certain address with predefined email data.

See also



Found a typo? Something wrong with this content?

Just fork and edit it.

Content of this work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license. Code snippets in examples are published under the CC0 1.0 Universal (CC0 1.0). Thanks to all contributors.