Download and Unzip to files smscmd readme.htm and sms4mail.txt . You can register your email to get password and free SMS to test |
Sample 1 : account and password input directly
root@vultr:~/smscmd# ls -al Sample 2 : account and password from encrypted file (vi to update your account and password in file sms4mail.txt first)
root@vultr:~/smscmd# vi
sms4mail.txt curl command sample. run under Linux command prompt or called by other program (Keep same format, change xxxxxxxx to your own) curl -d "email=xxxxxxx@xxxxxxx.xxx&pwd=xxxxxxxxx&text=xxxxxxxxxxxxxx&to=xxxxxxxxxxxxxx" -X POST https://www.sms4mail.com/smsmail/php/smscmd.php
Perl Samle1 Call smscmd and use encrypted password file smscmd.key download this sample code #!/usr/bin/perl #Download smscmd_linux.zip from sms4mail.com/download/linux/smscmd_linux.zip #Update email and password in sms4mail.txt and run ./smscmd genkey to encrypt password file to smscmd.key #Remove password file sms4mail.txt if ($#ARGV <=0) { print "\n smscmd for PERL -- sms4mail.com"; print "\n\n perl smscmd.pl 'text' 'phone1,phone2'"; print "\n\n Download smscmd_linux.zip from sms4mail.com/download/linux/smscmd_linux.zip first"; print "\n Unzip and update email and password file sms4mail.txt"; print "\n Run smscmd genkey to generate encrypted password file smscmd.key"; print "\n Remove sms4mail.txt for safety\n\n"; exit(0); } my $cmd = "./smscmd " . "'" . $ARGV[0] . "' '" . $ARGV[1] . "'"; system($cmd); print "SMS sent finished\n"; exit(0);
Perl sample 2 |
PHP Samle1 Call smscmd and use encrypted password file smscmd.key download this sample code
<?php PHP Sample2 <?php //// call this sample using POST method . ///////////////////////////////////////////////////////////// $text = $_POST["text"]; $to = $_POST["to"]; $email = $_POST["email"]; $pwd = $_POST["pwd"]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $url = "http://www.sms4mail.com/smsmail/php/smscmd.php"; $post = array( "text"=>"$text", "to" => "$to", "email"=>"$email", "pwd"=>"$pwd", ); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); // execute $response = curl_exec($ch); // close the connection curl_close($ch); // print response echo "$response"; ?> |
Python Samle1 Call smscmd and use encrypted password file smscmd.key download this sample code
#!/usr/bin/env python Python Sample2 Click here to download Python code and run directly - Working in x86 and ARM CPU
################################################################################################################### |