Sample code – Email2SMS – Delphi

If you are sending SMS from your System or an application with Delphi or Embarcadero, there are several possibilities with our SureSMS API.

Below is a sample code for Email2SMS - Delphi:

function PostExample: string;
var
  lHTTP: TIdHTTP;
  lParamList: TStringList;
begin
  lParamList := TStringList.Create;
  lParamList.Add('login=brugernavn');
  lParamList.Add('password=kodeord');
  lParamList.Add('to=+4540818824');
  lParamList.Add('from=MyCompany');
  lParamList.Add('message=Test besked');
  lHTTP := TIdHTTP.Create(nil); 
  try 
	Result := lHTTP.Post('https://api.suresms.com/Script/SendSMS.aspx/', lParamList); 
  finally 
	lHTTP.Free; 
	lParamList.Free; 
  end; 
end;

 

It is nessasary to change the parametres, so that they do match the username and Password, you recieved when opening your SureSMS account!

Be aware, that some hosting compagnies don't allow you to send an E-mail without sender-ID, or they only allow e.g 20 E-mail a day with out sender-ID.

Should you have any questions, you are allways welcome to send an E-mail to [email protected]. We are looking forward to helping you.

Need an account?

Do you still need an account or a free test account? Follow this link and we will make you one in 5 minuts.