• 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)
  • 2
1 Solution
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:

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!');


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.
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 
Post your closing recommendations!  No comment means you don't care.
I think, this thread needs to be continued. I could not provide an exhausting information because I need additional comments from the question author.

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