Jump to content

Recommended Posts

I am trying to gather as much information as possible about sending text messages to mobile phones  using PHP. I have a few questions like:

 

1) What is required/Free or Purchased Software?

2) Is it difficult to implement?

3) Where can I get more information about this topic?

4) Is it as simple as the PHP Script below?

<?php
/*Example code to send text messages written in php. 
This code requires phpmailer class. You can download 
free phpmailer from http://phpmailer.sourceforge.net/. This code is provided as sample only.
*/

require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "ipipi.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Port =25;
$mail->Username = "YoureIPIPIUsername"; // SMTP username at ipipi
$mail->Password = "YourPassword"; // SMTP password

$mail->From = "YourUserName@ipipi.com";
$mail->FromName = "Your Name";
$mail->AddAddressTo("DestinationPhoneNumber@sms.ipipi.com", "Receiver Name");

$mail->Subject = "Compression Option goes here - find out more";
$mail->Body = "Your Message";

if(!$mail->Send())
{
   echo "Message could not be sent. <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}
echo "Message has been sent";
?>

 

Note: Please do not answer this topic with "Try Google!" Thanks In Advance.

Link to comment
https://forums.phpfreaks.com/topic/71386-send-text-messages-using-php/
Share on other sites

Ive never tried to impliment it but it would be pretty straight forward. Just depends on the povider I suppose. Some (as in your example) may provide an email address to mail your sms too, others may provide some sort of api.

 

Sorry to say, but I'm afraid google and your provider are going to be your best research areas.

actually there are a few "free" ways to do it, but very unreliable.  You can use cURL to connect to a site that has it on it and you have it,  however the best mode is to simply pay for it and just have your own phone number so you don't have any legal issues.  I think verizon has an unlmited sms add on to a pre exisiting account for 9.99 and you can send via an account using cURl to their server.

all you do is send email

<?php
//AT&T / Cingular phone  [10 digit #]@mmode.com
mail("9055556543@mmode.com","Test Message","What are you doing?");

//Nextel phone  [10 digit #]@nextel.com
mail("7035551234@messaging.nextel.com","Test Message","What are you doing?");
?>

 

Extension List -> http://tinywords.com/mobile.html

I use this assuming all fileds in the form are OK or filled.

 

mail ('1234567890@messaging.nextel.com', 'Subject Goes here', 
"$text_message",

'From: WEBMASTER@YOURSITE.COM');

 

I get a text message with detail each time a user fills out a quote form.

This is for personal use so only I can receive the message.

 

 

 

The reason I create this topic is because I get these text messages from an account that I have when ever a payment is received. It isn't a SMS message but I text message. I was wondering how is it done because it  is interesting and could come in handy in the futures.

 

Thanks to all for your reply.

sms = text message

(Short messaging system)

 

There is a lot of hope for SMS protocols that eventually all your accounts/emails/devices will all be able to have a centralized sms user that will alert them of anything you want.  RSS feeds, Emails, Blog post, Site updates, etc.  The idea is that because sms is simple packet data that can transverse multiple transport layers of the OSI model, that it will be successfully on all devices.  Then after sms is successfully done, it will be updated to a LMS or a DSMS (long or dynamic) that will include more complex things such as a xml document type or possibly even a xhtml document depending on what bridge we are at at that point.

 

It is the wave of the future, and getting on it now is big, but I personally think it is going to be huge as I wrote above, it just needs a organization to create this centralized data bank for all the sms to transverse on and the way for all the devices to integrate.  I mean this could be huge image your aim,msn,email,yahoo,rss feeds. stock updates etc.  You can recieve huge amounts of data that is the same reguardless if you in your car, on your cell phone or on your desktop.

There is a wealth of information located across the internet.  Awhile ago I wrote a very simple interface to pull information about Amateur Radio operators.  Well I was just another face in a bunch of people that have created this same database and scripts to retrieve the info.  Then at night I was watch TV and noticed an advertisement for a Joke service.  Something poped in my mind and I said what if someone could send a txt message to receive this info and voila I was able to find a service provider that is FREE and I was able to get a simple php script set up.  Now when someone txt's a "Short Code" for my service provider and sends the message CALLSIGN followed by a US based callsign the system checks a URL www.mysite.com/specialfolder/callsign.php?call=xx1xxx of course the call sign is just what was typed in the txt message.

 

From concept to finished working product was a little over three hours.  I was able to accomplish this task because I used Google and other search engines.  I searced for things like "text messaging providers" this led me to information about companies and that those short number you txt to are called "Short Codes" eventually I found a site that lists them all for the USA and I was able to check them out and see what they had to offer and how much they were.  Using one of these companies you can do just exactly what you are wanting to do.

 

So the moral of the story is not to knock the people that say "Google it!" because they probably know from experience that Google and services like it can be of major help if you really apply yourself to finding it.  Now since I have subjected you to my little speach about Google and my endevors I will give you two websites that will help you find what you are looking for.

 

http://www.usshortcodes.com/

http://www.usshortcodeswhois.com/ (My Favorite Link)

 

Using the links above you will be dealing with people who offer short codes and the second one you can find companies that do nothing but txt for you there are a range of folks that can help you in different ways.  Wether it be to own your own short code (SPENDY $$$$) or to use someone elses or to just simply send only.  Hope this helps you or anyone else that is looking for sms based services.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.