Thursday, July 31, 2008

Send Free SMS to Mobitel (Sri Lanka)

You may wonder how these people send free SMS to mobitel. It’s not a wonder or a magic. There are some companies offering email to SMS service. In Sri Lanka only Mobitel is offering this service.
What you need to do is simply send a mail to
phoneNumber@sms.mobitel.lk. For example, if you wanna send a SMS to 071-5373891 then simply send a mail to 94715373891@sms.mobitel.lk!
If you know PHP or ASP or Perl then you can use this concept to create a widget that can send SMS to user.
You can get phone number as an input and then if you can generate an email as I described above then you have created the widget. I have already created a
widget to send free SMS using PHP. Here is the source code of that.

Client side

<html>

<head>
<title>root_j@hotmail.com</title>
</head>
<body>
<form method="POST" action="send.php">
<pp>
Number :-<input type="text" name="num" size="20"> Type online the Mobitel
number without 0 eg:- 714XXXXXX<br>
email:-<input type="text" name="email" size="20"><br>

Message<textarea rows="2" name="mess" cols="20"></textarea></p>
<p><input type="submit" value="Submit" name="B1"p>

<input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>

server Side save it as send.php

<?php
$num=$_POST['num'];
$p_email=$_POST['email'];
$p_mess=$_POST['mess'];
$sendem = "94".$num."@sms.mobitel.lk";
$to = $sendem;
$subject = $p_email;
$message = $p_mess;
$from = $p_email;
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Message send!!";
echo "<br&gt";
?&gt

Recenly I heard that Dialog is also lanching such a service for MMS. You just want to send a mail to yournumber@mms.dialog.lk and receiver will get it as a MMS.

Unfortunately other operators such as Tigo, Hutch doesn’t offer such service!!! If you need to send them mail then you need to buy a SMS gateway, which is very expensive.