• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 401
  • Last Modified:

How do I send an SMS using Delphi 5?

What components are necessary, and how do you go about writing code to send an SMS to a cellular phone?(Sample Code Would be nice)
0
Peter-Lalor
Asked:
Peter-Lalor
  • 2
1 Solution
 
msa2003Commented:
SMS could be sent from PC using cellular phone's operator's SMTP (e-mail) gateway. Different operators uses diferent gateways to let their users receive e-mail messages, but you could obtain the gateway address using your operator's customer support. The mailbox address probably will look like:
XXXXXXX@server.com

where XXXXXXX - phone number; server.com - gateway address.

To implement SMTP protocol in Delphi you will need Indy SMTP client (TIdSMTP). Place it on the form. Here is an example of how to use TIdSMTP component to send SMS message (assuming it is called IdSMTP1):

IdSMTP1.QuickSend('smtp.provider.net', 'Subject', 'XXXXXXX@server.com',
    'myaddr@provider.net', 'Hello, world!');

Where:

smtp.provider.net - your Internet provider's SMTP server where you have a valid mailbox or any public mail service with SMTP access (slower);

Subject - the subject of the message;

XXXXXXX@server.com - phone's e-mail;

myaddr@provider.net - mailbox address from which to send SMS;

Hello, world! - message body.

If you have not Indy components ask me and I will provide source code which to use TClientSocket component or WinSock API to send a message.

Some mobile providers also has HTTP gateways. Somtimes usage of HTTP is better than SMTP.
0
 
CleanupPingCommented:
Peter-Lalor:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
msa2003Commented:
I think, this thread needs to be continued. I could not provide an exhausting information because I need additional comments from the question author.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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