Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1084
  • Last Modified:

SMS & Delphi 5

Hi all,

Has anyone done anything with SMS before using Delphi?  I need to write something which sends a message using SMS.  The carrier we are using has a local dial-in number, you send the message, then hang up.

Any ideas or components which could help me with this?  Some code would be very nice :)

Cheers,

Stuart.
0
Stuart_Johnson
Asked:
Stuart_Johnson
  • 5
  • 3
  • 2
  • +6
1 Solution
 
shenqwCommented:
listen
0
 
tomer_engelCommented:
yes, a very simple solution:

enter the courires web page and see exactly what it is doing when you send the sms message, meaning ,the sms sending is done by an exe file on the carrier's server, so when you send messages through the carrier you just give the .exe file the command line arguments and the file's doing the rest.
 
so,very simple , view the source code in the web page, and do exactly as they are doing (only in your application):
a)you sould expect an asp page: to open the asp page, couple of steps maximum:
go into the web site, after it's fully loaded, choose the view|source from the menu, if it's a long page and it has conditions and stuff in it thn bingo if not, look for an .asp page in it, and load the address in your browser::
if you see a line like this
<FRAME MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE SCROLLING=auto SRC="http://www..../..../send_message_form.asp" name="out">

the load in the address edit box in the browser the address of the asp page : http://www...../.../send_message_form.asp

now you have the code ,(even if your not fammiliar with asp it's very easy to understand), implement the same code in a delphi application , add the TClientSocket to your application ,in it's host propery enter the web's address( the http address/ or the asp address , you should check), and that's all

hope i helped

enjoy....




0
 
mullet_attackCommented:
Our local Telco has a dial-in number that you access via a terminal session (eg Hyper terminal). Is this how your carrier implements their dialin? If so, I have a component that does the job. If not, some more details on how you use your carrier's dial-in service please.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
AleqCommented:
listening
0
 
intheCommented:
these are all i ever seen that could be used in delphi though are not cheap :-(

http://www.derdack.com/products/developer.html

The Message Master Developer Suite offers two separate powerful components for wireless messaging, one for sending alphanumeric messages to mobile phones or pagers per modem or ISDN connections and one for sending AND receiving messages with PC connected GSM phones (serial or infrared).
 
Both components integrate three technologies:
(1) Microsoft's latest component technology COM (Component Object Model) enables you to build contemporary software components
(2) Full ActiveX controls and can even be used within HTML pages (client-sided)
(3) Windows Win32 Dynamic Link Libraries (DLL)
You have the choice!
blah blah ...

cheers Barry
 
0
 
Stuart_JohnsonAuthor Commented:
tomer_engel: unfortunately I can't see this solving my problem.  As I said, I need it to dial into our carrier, not using the net.  Thanks anyway for the input.

mullet_attack: Could you either give me a link to this component, or email it too me at enigma@nlc.net.au?  Thanks, I'll definately take a look at it.

And Barry.  How are you?  I haven't been around much lately.  Just started a new job and I'm still trying to get a feel for the place.  It's weird working somewhere new after 3 years at the same place.

I like what you have shown here.  I'll take a look at the web site mentioned later today (during lunch) and get back too you.  I'm not sure what sort of a budget we have to do this, so if it's too expensive, it may not be a viable option.

Thanks all so far.  Keep the ideas rolling!


Stu.
0
 
Stuart_JohnsonAuthor Commented:
Hi Barry.

Unfortunately, the components where a little on the expensive side - especially for a simple job like this.  Thanks anyway.

Stu.
0
 
Stuart_JohnsonAuthor Commented:
mullet_attack.  I got your component and forwarded it onto the guy doing the job.  He seems to think it will do the job perfectly.  Thanks very much!

Stu.
0
 
hakanbCommented:
Hi Stuart,

Gone thru the comments & answers of your question and I am also interested in the component you have received from mullet_attack. Could you send it to me?
hakanb@intermat.com.tr
Thanks.
0
 
mullet_attackCommented:
Perhaps you should ask Mullet_Attack, after all, he does own the copyright...
0
 
hakanbCommented:
Sorry Mullet_Attack, my mistake.

I should have asked you in the first place. Could you please send me the component?

Thanks.
Hakan
hakanb@intermat.com.tr
0
 
mullet_attackCommented:
done.
0
 
yarasaCommented:
Hello mullet_attack did you done a sms software? If yes can you please send it's source or the component you used?
yarasa@yarasa.org
Thanks.
0
 
tomer_engelCommented:
hello mullet_atack--I'll join the gang and ask you send thesource code too,please.

THANX
Tomer      Tomer_engel@hotmail.com
0
 
mullet_attackCommented:
Hi Tomer,

The SMS component in question was a simple solution that works for me. My Telco has a dial-in terminal session, and the component simply responds to the text prompts. It also uses a 3rd party Comms library, Asynch Pro for Delphi, so unless you own that, and your Telco works the same way, the component will not work for you. However, my ideas may be of interest or value, so you are welcome to the source

BTW, if anyone makes a billion dollars from this, I'd like a small 0.001% please :-)

-----------------------------
unit SMS;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  AdPort, AdSModem, AdTapi, AdPacket;

type
  TSMS = class(TComponent)
  private
    fPhone1 : string;
    fPhone2 : string;
    fPhone3 : string;
    fMessage1 : string;
    fMessage2 : string;
    fMessage3 : string;
    fApdComport : TApdComport;
    fApdTapiDevice : TApdTapiDevice;
    fApdDataPacket: TApdDataPacket;
    MessageNum : integer;
  protected
    procedure GotStringPacket(Sender: TObject; Data: String);
    procedure SetApdDataPacket(value : TApdDataPacket);
  public
    procedure Dial;
    { Public declarations }
  published
    property Phone1 : string read fPhone1 write fPhone1;
    property Phone2 : string read fPhone2 write fPhone2;
    property Phone3 : string read fPhone3 write fPhone3;
    property Message1 : string read fMessage1 write fMessage1;
    property Message2 : string read fMessage2 write fMessage2;
    property Message3 : string read fMessage3 write fMessage3;
    property ApdComport : TApdComport read fApdComport write fApdComport;
    property ApdTapiDevice : TApdTapiDevice read fApdTapiDevice write fApdTapiDevice;
    property ApdDataPacket : TApdDataPacket read fApdDataPacket write SetApdDataPacket;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Planetech', [TSMS]);
end;

{ TSMS }

procedure TSMS.Dial;
begin
  if ((fApdTapiDevice <> nil) and (ApdComport <>nil) and (fApdDataPacket <> nil)) then
    begin
      fApdDataPacket.OnStringPacket := GotStringPacket;
      MessageNum := 1;
      TApdTapiDevice(fApdTapiDevice).Dial('0418707767');
    end;
end;

procedure TSMS.GotStringPacket(Sender: TObject; Data: String);
begin
  inherited;
  if Pos('JUST RETURN TO QUIT',Data)>0 then
    begin
      case MessageNum of
        1:
          begin
            if Phone1 <> '' then
              Apdcomport.PutString(Phone1);
          end;
        2:
          begin
            if Phone2 <> '' then
              Apdcomport.PutString(Phone2);
          end;
        3:
          begin
            if Phone3 <> '' then
              Apdcomport.PutString(Phone3);
          end;
      end;
      Apdcomport.PutChar(#13);
    end
  else
  if Pos('ENTER MESSAGE',Data)>0 then
    begin
      case MessageNum of
        1:
          begin
            if Message1 <> '' then
              Apdcomport.PutString(Message1);
          end;
        2:
          begin
            if Message2 <> '' then
              Apdcomport.PutString(Message2);
          end;
        3:
          begin
            if Message3 <> '' then
              Apdcomport.PutString(Message3);
          end;
       end;
      Apdcomport.PutChar(#13);
      Inc(messageNum);
    end
  else
  if Pos('THANK YOU',Data)>0 then
    APDTapiDevice.Cancelcall;

end;

procedure TSMS.SetApdDataPacket(value: TApdDataPacket);
begin
  if value <> nil then
    fApdDataPacket := value
  else
   fApdDataPacket := nil;
end;

end.
0
 
lingxinCommented:
mullet_attack :
HELLO!
AdPort, AdSModem, AdTapi, AdPacket;
i don't find these dcu file.
i can give you 100 points for you email
me .
os@8848.net
0
 
mullet_attackCommented:
"It also uses a 3rd party Comms library, Asynch Pro for Delphi, so unless you own that..."


I don't think 100 points would excuse piracy. You need to either buy this product, or adapt my simple code to use a freeware comms library.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 3
  • 2
  • +6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now