AxSms.Dialup
Introduction
Skip to properties and methods
The Dialup object lets you send SMS messages using a Hayes compatible modem (1200 bps or higher). The modem connects to an SMSC dial-in service provider to deliver the SMS message.
You can use the Dialup object to send SMS messages. Receiving messages is not supported. The Dialup object can only send messages one by one.
The Dialup object communicates with a normal modem using either a direct COM port or a Windows telephony device. It is recommended to use Windows telephony devices, for example ‘Standard 9600 bps Modem’.
If you use a Windows telephony device, settings are controlled by the Windows telephony driver. You can configure them through the Phone and Modem settings:
- Open the Windows Control Panel from the Start menu;
- Double-click on Phone and Modem Options and select the Modems tab;
- Select the preferred modem and click Properties. From here you can change the settings.
You can only send plain text messages. To send advanced SMS messages (such as flash, multi-part messages, data, ringtones, or Unicode) use the Gsm or Smpp object.
There are two types of SMSC dial-in providers:
- TAP/XIO providers;
- UCP providers.
The Dialup object supports both. Our list of supported SMSC providers shows the type (TAP/XIO or UCP) for each provider.
Send SMS using Dialup
Send an SMS through the Dialup (UCP/TAP-XIO) protocol object.
$objDialup = New-Object -ComObject AxSms.Dialup # Create Dialup protocol object
$objConstants = New-Object -ComObject AxSms.Constants # Create global constants object
$objMessage = New-Object -ComObject AxSms.Message # Create SMS message object
Write-Host "SMS Component Version $($objDialup.Version); Build $($objDialup.Build); " `
"Module $($objDialup.Module)"
Write-Host "License Status: $($objDialup.LicenseStatus)`n"
$objDialup.LogFile = "log.txt"
$objDialup.Device = "COM2"
$objDialup.DeviceSpeed = 56000
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410" # Dialup provider
$objMessage.ToAddress = "31122334455"
$objMessage.Body = "Hello, World!"
$objDialup.Send($objMessage) # Send SMS message
if ($objDialup.LastError -ne 0) {
Write-Host "Error: $($objDialup.GetErrorDescription($objDialup.LastError))"
exit 1
}
var objDialup = new AxSms.Dialup(); // Create Dialup protocol object
var objConstants = new AxSms.Constants(); // Create global constants object
var objMessage = new AxSms.Message(); // Create SMS message object
Console.WriteLine($"SMS Component Version {objDialup.Version}; Build {objDialup.Build}; " +
$"Module {objDialup.Module}");
Console.WriteLine($"License Status: {objDialup.LicenseStatus}\n");
objDialup.LogFile = "log.txt";
objDialup.Device = "COM2";
objDialup.DeviceSpeed = 56000;
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410"; # Dialup provider
objMessage.ToAddress = "31122334455";
objMessage.Body = "Hello, World!";
objDialup.Send(objMessage); # Send SMS message
if (objDialup.LastError != 0)
{
Console.WriteLine($"Error: {objDialup.GetErrorDescription(objDialup.LastError)}");
return 1;
}
Set objDialup = CreateObject("AxSms.Dialup") ' Create Dialup protocol object
Set objConstants = CreateObject("AxSms.Constants") ' Create global constants object
Set objMessage = CreateObject("AxSms.Message") ' Create SMS message object
WScript.Echo "SMS Component Version " & objDialup.Version & "; Build " & _
objDialup.Build & "; Module " & objDialup.Module
WScript.Echo "License Status: " & objDialup.LicenseStatus & vbCrLf
objDialup.LogFile = "log.txt"
objDialup.Device = "COM2"
objDialup.DeviceSpeed = 56000
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410" ' Dialup provider
objMessage.ToAddress = "31122334455"
objMessage.Body = "Hello, World!"
objDialup.Send objMessage ' Send SMS message
If objDialup.LastError <> 0 Then
WScript.Echo "Error: " & objDialup.GetErrorDescription(objDialup.LastError)
WScript.Quit 1
End If
How to run this example
Properties and Methods
| Property | Type | Read/Write | Description |
| Version | String | Read | Version number of the SMS Component |
| Build | String | Read | Build number of the SMS Component |
| Module | String | Read | Module name of the SMS Component |
| LicenseStatus | String | Read | License Status |
| LicenseKey | String | Read/Write | License Key |
| LastError | Number | Read | Result of the last called method |
| LogFile | String | Read/Write | The path to a logfile which can be used for troubleshooting |
| Device | String | Read/Write | Name of the device you want to use for sending the SMS messages |
| DeviceSpeed | Number | Read/Write | The baudrate of the communication session |
| DeviceSettings | Number | Read/Write | Identifier indicating databits, parity and stopbits |
| DeviceInitString | String | Read/Write | Initialization string for the device |
| Dialmode | Number | Read/Write | Tone or Pulse. Default: Tone |
| ProviderDialString | String | Read/Write | Dial-string to dial-up to the provider |
| ProviderPassword | String | Read/Write | Optional password to log on to the provider (UCP only) |
| ProviderType | Number | Read/Write | Type of provider; can be UCP or TAP |
| ProviderResponse | String | Read | Last response from provider |
| Method | Description |
| Clear | Reset all properties to their default values |
| GetErrorDescription | Get the description of the given error |
| Sleep | Sleep for the specified number of milliseconds |
| GetDeviceCount | Return the number of Windows telephony devices installed on the local computer |
| GetDevice | Retrieve a Windows telephony device name |
| Send | Deliver the message to the SMSC provider. The SMSC provider will send the SMS message to the recipient |
| ProviderLoadConfig | Load SMSC specific parameters from a configuration file |
| ProviderSaveConfig | Save SMSC specific parameters to a configuration file |
| SaveLicenseKey | Save the License Key in the registry |
Version property
Returns the version number of the SMS Component.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
Write-Host "SMS Component Version $($objDialup.Version); Build $($objDialup.Build); " `
"Module $($objDialup.Module)"
Write-Host "License Status: $($objDialup.LicenseStatus)`n"
...
var objDialup = new AxSms.Dialup();
Console.WriteLine($"SMS Component Version {objDialup.Version}; Build {objDialup.Build}; " +
$"Module {objDialup.Module}");
Console.WriteLine($"License Status: {objDialup.LicenseStatus}\n");
...
Set objDialup = CreateObject("AxSms.Dialup")
WScript.Echo "SMS Component Version " & objDialup.Version & "; Build " & _
objDialup.Build & "; Module " & objDialup.Module
WScript.Echo "License Status: " & objDialup.LicenseStatus & vbCrLf
...
Build property
Returns the build number of the SMS Component.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
Write-Host "SMS Component Version $($objDialup.Version); Build $($objDialup.Build); " `
"Module $($objDialup.Module)"
Write-Host "License Status: $($objDialup.LicenseStatus)`n"
...
var objDialup = new AxSms.Dialup();
Console.WriteLine($"SMS Component Version {objDialup.Version}; Build {objDialup.Build}; " +
$"Module {objDialup.Module}");
Console.WriteLine($"License Status: {objDialup.LicenseStatus}\n");
...
Set objDialup = CreateObject("AxSms.Dialup")
WScript.Echo "SMS Component Version " & objDialup.Version & "; Build " & _
objDialup.Build & "; Module " & objDialup.Module
WScript.Echo "License Status: " & objDialup.LicenseStatus & vbCrLf
...
Module property
Returns the module name of the SMS Component.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
Write-Host "SMS Component Version $($objDialup.Version); Build $($objDialup.Build); " `
"Module $($objDialup.Module)"
Write-Host "License Status: $($objDialup.LicenseStatus)`n"
...
var objDialup = new AxSms.Dialup();
Console.WriteLine($"SMS Component Version {objDialup.Version}; Build {objDialup.Build}; " +
$"Module {objDialup.Module}");
Console.WriteLine($"License Status: {objDialup.LicenseStatus}\n");
...
Set objDialup = CreateObject("AxSms.Dialup")
WScript.Echo "SMS Component Version " & objDialup.Version & "; Build " & _
objDialup.Build & "; Module " & objDialup.Module
WScript.Echo "License Status: " & objDialup.LicenseStatus & vbCrLf
...
LicenseStatus property
The status of your license. If you have not licensed the product yet, the property holds the trial expiration date. For details, see Product Activation.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup # Create new instance
Write-Host "License Status: $($objDialup.LicenseStatus)"
Write-Host "License Key: $($objDialup.LicenseKey)"
var objDialup = new AxSms.Dialup(); // Create new instance
Console.WriteLine($"License Status: {objDialup.LicenseStatus}");
Console.WriteLine($"License Key: {objDialup.LicenseKey}");
Set objDialup = CreateObject("AxSms.Dialup") ' Create new instance
WScript.Echo "License Status: " & objDialup.LicenseStatus
WScript.Echo "License Key: " & objDialup.LicenseKey
LicenseKey property
A license key is required to unlock this component after the trial period has expired. Assign the LicenseKey property every time you create a new instance of this component (see code below). Alternatively, the LicenseKey property can be set automatically when the license key is stored in the registry. For details, see Product Activation.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup # Create new instance
$objDialup.LicenseKey = "XXXXX-XXXXX-XXXXX" # Assign your license key
Write-Host "LicenseKey: $($objDialup.LicenseKey)"
var objDialup = new AxSms.Dialup(); // Create new instance
objDialup.LicenseKey = "XXXXX-XXXXX-XXXXX"; // Assign your license key
Console.WriteLine($"LicenseKey: {objDialup.LicenseKey}");
Set objDialup = CreateObject("AxSms.Dialup") ' Create new instance
objDialup.LicenseKey = "XXXXX-XXXXX-XXXXX" ' Assign your license key
WScript.Echo "LicenseKey: " & objDialup.LicenseKey
LastError property
Completion code of the last called method. To find the error description of a given error code, go to the online error codes page.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
Write-Host "Send result: $($objDialup.LastError)" # Is our message sent ?
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
Console.WriteLine($"Send result: {objDialup.LastError}"); // Is our message sent ?
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
WScript.Echo "Send result: " & objDialup.LastError ' Is our message sent ?
...
LogFile property
By default, LogFile holds an empty string and nothing is logged. If you assign a valid file name, the SMS Component writes debug information to this file. Output data is appended to the end of the file.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
Device property
The preferred device for sending SMS messages. You can use either a Windows telephony device (recommended) or a physical COM port.
Assign one of the following strings to the Device property:
- A valid Windows telephony device name. This must be the exact name as it appears in the Modems tab of the Phone and Modem Options applet in the Control Panel. For example: “Standard 9600 bps Modem”. Use the GetDevice method to retrieve Windows telephony device names.
- A valid COM port string formatted as COMx, where x is a valid COM port number. When you assign a COM port string, you bypass all Windows telephony features such as dialing rules and port sharing.
Windows telephony devices are highly recommended.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.Device = "COM1"
$objDialup.DeviceSpeed = $objConstants.GSM_BAUDRATE_56000
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.Device = "COM1";
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000;
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.Device = "COM1"
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
DeviceSpeed property
By default, the speed settings are inherited from the Windows telephony device, or (when a direct COM port is used) the default COM settings are used.
Use one of these values.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.DeviceSpeed = $objConstants.GSM_BAUDRATE_56000
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000;
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
DeviceSettings property
By default, the databits/parity/stopbits settings are inherited from the Windows telephony device, or (when a direct COM port is used) the default COM settings are used (8 databits, no parity, 1 stopbit).
Use one of these values.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.DeviceSpeed = $objConstants.GSM_BAUDRATE_56000
$objDialup.DeviceSettings = $objConstants.DIALUP_DEVICESETTINGS_8N1
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000;
objDialup.DeviceSettings = objConstants.DIALUP_DEVICESETTINGS_8N1;
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000
objDialup.DeviceSettings = objConstants.DIALUP_DEVICESETTINGS_8N1
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
DeviceInitString property
Initialization string for the modem. The following rules apply:
- If a Windows telephony device is used, the Windows telephony initialization string is used. The DeviceInitString property is ignored.
- If a direct COM port is used, the DeviceInitString property is used to initialize the device.
Commands can be separated by the ‘;’ character and are issued separately. For example, if DeviceInitString holds “ATZ”, the component first issues ATZ, waits for OK, then issues AT&C1&K0 and waits for OK again.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.DeviceSpeed = $objConstants.GSM_BAUDRATE_56000
$objDialup.DeviceInitString = "AT&F;AT&C1&K0"
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000;
objDialup.DeviceInitString = "AT&F;AT&C1&K0";
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000
objDialup.DeviceInitString = "AT&F;AT&C1&K0"
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
Dialmode property
Set the Dialmode property to specify tone or pulse dialing. Click here for the values.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.Dialmode = $objConstants.DIALUP_DIALMODE_TONE
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.Dialmode = objConstants.DIALUP_DIALMODE_TONE;
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.Dialmode = objConstants.DIALUP_DIALMODE_TONE
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
ProviderDialString property
Dial string to dial-up to the provider.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.DeviceSpeed = $objConstants.GSM_BAUDRATE_56000
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000;
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
ProviderPassword property
Password used to log on to the provider. The majority of TAP/UCP providers do not require a password. If a password is required, you can set it here.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.DeviceSpeed = $objConstants.GSM_BAUDRATE_56000
$objDialup.ProviderPassword = "Passw0rd"
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000;
objDialup.ProviderPassword = "Passw0rd";
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.DeviceSpeed = objConstants.GSM_BAUDRATE_56000
objDialup.ProviderPassword = "Passw0rd"
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
ProviderType property
Type of provider. Click here for a list of values.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
...
ProviderResponse property
ProviderResponse holds the last response from the Dial-Up provider. Use it for troubleshooting.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objMessage = New-Object -ComObject AxSms.Message
$objConstants = New-Object -ComObject AxSms.Constants
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
...
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
Write-Host $objDialup.ProviderResponse
...
var objDialup = new AxSms.Dialup();
var objMessage = new AxSms.Message();
var objConstants = new AxSms.Constants();
objDialup.LogFile = @"C:\temp\log.txt";
...
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
Console.WriteLine(objDialup.ProviderResponse);
...
Set objDialup = CreateObject("AxSms.Dialup")
Set objMessage = CreateObject("AxSms.Message")
Set objConstants = CreateObject("AxSms.Constants")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
..
objDialup.Send objMessage
WScript.Echo objDialup.ProviderResponse
...
Clear method
This method resets all properties to their default values.
Parameters:
- None
Return value:
Always returns 0.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
...
$objDialup.Clear()
...
var objDialup = new AxSms.Dialup();
...
objDialup.Clear();
...
Set objDialup = CreateObject("AxSms.Dialup")
....
objDialup.Clear
...
GetErrorDescription method
GetErrorDescription provides the error description for a given error code.
Parameters:
- The error code
Return value:
The error string.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objDialup.LogFile = "C:\temp\log.txt"
...
$objMessage = New-Object -ComObject AxSms.Message
$objMessage.ToAddress = "+31611223344"
$objMessage.Body = "Short text message"
$objDialup.Send($objMessage)
Write-Host "SendSms result: $($objDialup.LastError), " `
"$($objDialup.GetErrorDescription($objDialup.LastError))"
var objDialup = new AxSms.Dialup();
objDialup.LogFile = @"C:\temp\log.txt";
...
var objMessage = new AxSms.Message();
objMessage.ToAddress = "+31611223344";
objMessage.Body = "Short text message";
objDialup.Send(objMessage);
Console.WriteLine($"SendSms result: {objDialup.LastError}, " +
$"{objDialup.GetErrorDescription(objDialup.LastError)}");
Set objDialup = CreateObject("AxSms.Dialup")
objDialup.LogFile = "C:\temp\log.txt"
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.ToAddress = "+31611223344"
objMessage.Body = "Short text message"
objDialup.Send objMessage
WScript.Echo "SendSms result: " & objDialup.LastError & ", " & _
objDialup.GetErrorDescription(objDialup.LastError)
Sleep method
This method suspends the current thread for the specified number of milliseconds.
Parameters:
- Milliseconds to sleep
Return value:
Always returns 0.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
...
$objDialup.Sleep(1000)
...
var objDialup = new AxSms.Dialup();
...
objDialup.Sleep(1000);
...
Set objDialup = CreateObject("AxSms.Dialup")
....
objDialup.Sleep 1000
...
GetDeviceCount method
Returns the number of Windows telephony devices installed on the local computer.
Parameters:
- None
Return value:
The number of devices.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
...
$n = $objDialup.GetDeviceCount()
for ($i = 0; $i -lt $n; $i++) {
Write-Host "Device $i`: $($objDialup.GetDevice($i))"
}
...
var objDialup = new AxSms.Dialup();
...
int n = objDialup.GetDeviceCount();
for (int i = 0; i < n; i++)
{
Console.WriteLine($"Device {i}: {objDialup.GetDevice(i)}");
}
...
Set objDialup = CreateObject("AxSms.Dialup")
....
n = objDialup.GetDeviceCount()
For i = 0 to n-1
WScript.Echo "Device " & i & ": " & objDialup.GetDevice( i )
Next
...
GetDevice method
Returns the name of a Windows telephony device.
Parameters:
- Index of the device (0-based)
Return value:
The device name.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
...
$n = $objDialup.GetDeviceCount()
for ($i = 0; $i -lt $n; $i++) {
Write-Host "Device $i`: $($objDialup.GetDevice($i))"
}
...
var objDialup = new AxSms.Dialup();
...
int n = objDialup.GetDeviceCount();
for (int i = 0; i < n; i++)
{
Console.WriteLine($"Device {i}: {objDialup.GetDevice(i)}");
}
...
Set objDialup = CreateObject("AxSms.Dialup")
....
n = objDialup.GetDeviceCount()
For i = 0 to n-1
WScript.Echo "Device " & i & ": " & objDialup.GetDevice( i )
Next
...
Send method
Sends the message to the SMSC provider. The provider then delivers the SMS to the recipient.
Parameters:
- Message object
Return value:
Always returns 0.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objConstants = New-Object -ComObject AxSms.Constants
...
$objMessage.ToAddress = "31623350218"
$objMessage.Body = "Hello world!"
...
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.Send($objMessage)
var objDialup = new AxSms.Dialup();
var objConstants = new AxSms.Constants();
...
objMessage.ToAddress = "31623350218";
objMessage.Body = "Hello world!";
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.Send(objMessage);
Set objDialup = CreateObject("AxSms.Dialup")
Set objConstants = CreateObject("AxSms.Constants")
...
objMessage.ToAddress = "31623350218"
objMessage.Body = "Hello world!"
...
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
...
objDialup.Send objMessage
ProviderLoadConfig method
Loads SMSC specific parameters from a configuration file.
Parameters:
- Path to the configuration file
Return value:
Always returns 0.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objConstants = New-Object -ComObject AxSms.Constants
...
$objDialup.ProviderLoadConfig("D:\Auron\SMS Component\MyProvider.dial")
var objDialup = new AxSms.Dialup();
var objConstants = new AxSms.Constants();
...
objDialup.ProviderLoadConfig(@"D:\Auron\SMS Component\MyProvider.dial");
Set objDialup = CreateObject("AxSms.Dialup")
Set objConstants = CreateObject("AxSms.Constants")
...
objDialup.ProviderLoadConfig "D:\Auron\SMS Component\MyProvider.dial"
ProviderSaveConfig method
Saves provider specific information to a configuration file. A previous file will be overwritten automatically.
Parameters:
- Path to the configuration file
Return value:
Always returns 0.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup
$objConstants = New-Object -ComObject AxSms.Constants
...
$objDialup.Dialmode = $objConstants.DIALUP_DIALMODE_TONE
$objDialup.ProviderPassword = "Passw0rd"
$objDialup.ProviderType = $objConstants.DIALUP_PROVIDERTYPE_UCP
$objDialup.ProviderDialString = "0653141410"
...
$objDialup.ProviderSaveConfig("D:\Auron\SMS Component\MyProvider.dial")
var objDialup = new AxSms.Dialup();
var objConstants = new AxSms.Constants();
...
objDialup.Dialmode = objConstants.DIALUP_DIALMODE_TONE;
objDialup.ProviderPassword = "Passw0rd";
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP;
objDialup.ProviderDialString = "0653141410";
...
objDialup.ProviderSaveConfig(@"D:\Auron\SMS Component\MyProvider.dial");
Set objDialup = CreateObject("AxSms.Dialup")
Set objConstants = CreateObject("AxSms.Constants")
...
objDialup.Dialmode = objConstants.DIALUP_DIALMODE_TONE
objDialup.ProviderPassword = "Passw0rd"
objDialup.ProviderType = objConstants.DIALUP_PROVIDERTYPE_UCP
objDialup.ProviderDialString = "0653141410"
...
objDialup.ProviderSaveConfig "D:\Auron\SMS Component\MyProvider.dial"
SaveLicenseKey method
Description:
Use SaveLicenseKey to store the license key permanently in the registry. When you save a license key, the component restores it automatically every time you create a new instance of the object. It is not recommended to save the license key if you distribute the component with your own software, because the key can be used by others.
Parameters:
- None.
Return value:
Always returns 0. Check the LastError property to see if the method completed successfully.
Example:
$objDialup = New-Object -ComObject AxSms.Dialup # Create new instance
$objDialup.LicenseKey = "XXXXX-XXXXX-XXXXX"
$objDialup.SaveLicenseKey() # Save license key to registry
var objDialup = new AxSms.Dialup(); // Create new instance
objDialup.LicenseKey = "XXXXX-XXXXX-XXXXX";
objDialup.SaveLicenseKey(); // Save license key to registry
Set objDialup = CreateObject("AxSms.Dialup") ' Create new instance
objDialup.LicenseKey = "XXXXX-XXXXX-XXXXX"
objDialup.SaveLicenseKey ' Save license key to registry
For more information, see Product Activation.