免费发短信(仅限美国国内)How to Send Free Text Messages Using PHP

本文介绍了一种使用PHP通过手机运营商内置的电子邮件地址发送短信的方法,作为成本效益高的替代方案,代替昂贵的短信服务。操作时需要知道收信人的运营商信息,适用于收集了用户运营商信息的场景。代码示例和主要美国运营商的电子邮件地址列表也一并提供。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

测试DEMO

 

I am currently working on a large project and part of the project is to send simple text message notices using PHP.  Our client had looked into a number of expensive services to send simple SMS messages but most were cost prohibitive for a start-up venture.

As usual, I was not satisfied paying for something that I should be able to do on my own. So I started thinking about how the messaging systems worked and realized that we could just use the carriers built in email addresses for MMS messaging.  This is a great, cost effective method for sending text messages but it does require that you know the user’s carrier for the message to be successfully delivered.  In our case, we are able to ask for that in the web form which we are using to collect the user’s phone number but it may not work for every application. 

 

Basically the solution is to send an email using the built in mail function in PHP or any common method of sending email.  The email address you would send to would be the 10 digit mobile number followed by the carriers specific email address. (A list is included below)

 

Email addresses for the primary U.S. based cell phone carriers:
Alltel = xxxxxxxxxx@message.alltel.com
AT&T = xxxxxxxxxx@mms.att.net or xxxxxxxxxx@txt.att.net
Boost Mobile = xxxxxxxxxx@myboostmobile.com
Centennial Wireless = xxxxxxxxxx@myblue.com
Einstein PCS = xxxxxxxxxx@einsteinmms.com
Nextel = xxxxxxxxxx@messaging.nextel.com
Sprint = xxxxxxxxxx@messaging.sprintpcs.com or xxxxxxxxxx@pm.sprint.com
T-Mobile = xxxxxxxxxx@tmomail.net
US Cellular = xxxxxxxxxx@mms.uscc.net
Verizon Wireless = xxxxxxxxxx@vtext.com
Virgin Mobile = xxxxxxxxxx@vmobl.com

 

The simple PHP code to send the email:

//SUBJECT AND BODY OF EMAIL SHOULD BE LESS THAN 160 CHARACTERS TOTAL
$subject = "Text Message Subject";
$message = "Text Message Content"; 
 
//SENDS TEXT MESSAGE TO 503-869-4212
mail("5038694212@txt.att.net",$subject,$message,"From: email@site.net");

 

 

原文:http://www.stemkoski.com/sending-text-messages-using-php-for-free/

更多carrier:

http://www.sensiblesoftware.com/weblog/2011/02/28/cell-phone-email-addresses/

http://networking.ringofsaturn.com/Telecommunications/mobile-phone-emails.php

 

测试DEMO

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值