Jump to content

SMS UDF


DisabledMonkey
 Share

Recommended Posts

Cleaner, though I was more thinking about trying to use the Constants as the items.

Making a listview that is all those Constants, that when selected return the value set in the SMS.AU3.

(leaving no need to redefine everybody in SMSsend script).

In all my efforts I had to redefine the variable in SMSsend at some point.

**The assigned value effort was makeshift being unable to accomplish this***

Lookup Eval and/or Execute in the AutoIT help file. Might help you with what you are looking for.

Link to comment
Share on other sites

Just something I found online quick

You need to first enable the Mobile Email service. You can login to T-Mobile and enable it yourself under "Plan". T-Mobile told me there's no setup fee, no monthly fee, and no *inbound* (email-2-sms) fee. There is a fee for *outbound* (sms-2-email), but I can't see anyone here caring about that.

The n in what you found online just stands for your number which i put in automatically, so the service provider I used in my UDF appears to be correct. Just try to enable Mobile Email service on your t-mobile plan and try the UDF again, should work then

Disabled Monkey

Thanks for taking the time to look, but I just dont think this is available in the UK.

It would be "Free", and we arnt allowed free here ;)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Opt ("ExpandVarStrings", 1) was my solution to prevent having to re-declare anything.

#include <SMS.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#Include <GuiListView.au3>

Opt("ExpandVarStrings", 1)

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("SMS", 336, 232, 189, 120)
GUISetBkColor (0x00AAAA)
$InputSvr = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "SERVER" , "SERVER"), 16, 16, 145, 21)
$Inputemail = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "EMAIL" , "EMAIL"), 16, 48, 145, 21)
$Inputuser = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "USER" , "USER"), 16, 80, 145, 21)
$Inputpass = GUICtrlCreateInput("PASSWORD", 16, 112, 145, 21)
;~ $Inputpass = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "password" , "password"), 16, 112, 145, 21)
$Inputnum = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "NUMBER" , "NUMBER"), 16, 144, 145, 21)
$Inputmsg = GUICtrlCreateInput("MESSAGE", 184, 16, 137, 75)
$Button1 = GUICtrlCreateButton("OK", 128, 184, 75, 25)
$listview = GUICtrlCreateList("$$Verizon$", 184, 96, 137, 75)
GuiCtrlSetData ($listview, "$$ATT_WIRELESS$")
GuiCtrlSetData ($listview, "$$ALLTEL$")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select 
                
        
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        
    Case $nMsg = $Button1
        
        IniWrite ("C:\SMS.ini" , "INFO" , "server" , GUIctrlread($inputsvr))
        IniWrite ("C:\SMS.ini" , "INFO" , "email" , GUIctrlread($inputemail))
        IniWrite ("C:\SMS.ini" , "INFO" , "user" , GUIctrlread($inputuser))
;~         IniWrite ("C:\SMS.ini" , "INFO" , "password" , GUIctrlread($inputpass))
        IniWrite ("C:\SMS.ini" , "INFO" , "number" , GUIctrlread($inputnum))
        
        
$server = GuiCtrlRead ($inputsvr)
$email = GuiCtrlRead ($inputemail)
$username = GuiCtrlRead ($inputuser)
$password = GuiCtrlRead ($inputpass)
$port = 465
$ssl = 1
$number = GuiCtrlRead ($inputnum)
$message = GuiCtrlRead ($inputmsg)
$service = GUICtrlRead($listview)


$sms = _StartSMS($server,$email,$username,$password,$port,$ssl)
_SendSMS($sms,$number,$service,$message)
;~     

exit

    EndSelect
WEnd

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Updated UDF... See first post

Added 168 new consts.

274 consts total.

Some of the new consts are for pager gateways.

Formatted UDF to follow UDF guidelines better:

More error checking in place.

Functions are commented.

Functions renamed:

_SMS_Start($sSMTP,$sEmail,$sUsername,$sPassword,$iPort = 25,$iSSL = 0)

_SMS_Send($aSMS,$iNumber,$sService,$sMessage,$sFromName = "")

@SprinterGuru - This UDF doesn't support countries, but instead supports service providers. You will have to check the const's in the UDF itself to see if the service provider you want is in there, or you could look up your service provider's sms gateway and use that instead of one of my const's.

Link to comment
Share on other sites

  • 3 weeks later...

This worked before your last update, but I'm now getting:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "F:\Files\_Documents\_au3\SMS\sender.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams

+>22:39:31 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0409 Keyboard:00000409 OS:WIN_7/ CPU:X64 OS:X64)

>Running AU3Check (1.54.19.0) from:C:\Program Files (x86)\AutoIt3

+>22:39:31 AU3Check ended.rc:0

>Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "F:\Files\_Documents\_au3\SMS\sender.au3"

### COM Error ! Number: 80020009 ScriptLine: 408 Description:The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available

+>22:39:39 AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 9.571

EDIT: Sorry, that was my fault. I had a typo in the email address...

I apologize for the inconvenience I could have caused.

Edited by cembry90

AutoIt Stuff:

 

UDFs: {Grow}

Link to comment
Share on other sites

hi

SMS.au3 (338) : ==> Subscript used with non-Array variable.:

$rc = _INetSmtpMailCom($aSMS[0], $sFromName, $aSMS[1], _GetAddress($iNumber,$sService), $sMessage, $aSMS[2], $aSMS[3], $aSMS[4], $aSMS[5])

$rc = _INetSmtpMailCom($aSMS^ ERROR

thats the error i get at the moment.

i use an altered version of iamthekeys GUI

#include <SMS.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#Include <GuiListView.au3>

Opt("ExpandVarStrings", 1)

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("SMS", 336, 232, 189, 120)
GUISetBkColor (0x00AAAA)
$InputSvr = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "SERVER" , "SERVER"), 16, 16, 145, 21)
$Inputemail = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "EMAIL" , "EMAIL"), 16, 48, 145, 21)
$Inputuser = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "USER" , "USER"), 16, 80, 145, 21)
$Inputpass = GUICtrlCreateInput("PASSWORD", 16, 112, 145, 21)
;~ $Inputpass = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "password" , "password"), 16, 112, 145, 21)
$Inputnum = GUICtrlCreateInput(iniread ("C:\SMS.ini", "INFO" , "NUMBER" , "NUMBER"), 16, 144, 145, 21)
$Inputmsg = GUICtrlCreateInput("MESSAGE", 184, 16, 137, 75)
$Button1 = GUICtrlCreateButton("OK", 128, 184, 75, 25)
$listview = GUICtrlCreateList("$$E_PLUS_GERMANY$", 184, 96, 137, 75)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select 
                
        
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        
    Case $nMsg = $Button1
        
        IniWrite ("C:\SMS.ini" , "INFO" , "server" , GUIctrlread($inputsvr))
        IniWrite ("C:\SMS.ini" , "INFO" , "email" , GUIctrlread($inputemail))
        IniWrite ("C:\SMS.ini" , "INFO" , "user" , GUIctrlread($inputuser))
;~         IniWrite ("C:\SMS.ini" , "INFO" , "password" , GUIctrlread($inputpass))
        IniWrite ("C:\SMS.ini" , "INFO" , "number" , GUIctrlread($inputnum))
        
        
$ssmtp = GuiCtrlRead ($inputsvr)
$semail = GuiCtrlRead ($inputemail)
$susername = GuiCtrlRead ($inputuser)
$spassword = GuiCtrlRead ($inputpass)
$iport = 465
$ssl = 1
$inumber = GuiCtrlRead ($inputnum)
$smessage = GuiCtrlRead ($inputmsg)
$sservice = GUICtrlRead($listview)


$asms = _SMS_Start($sSMTP,$sEmail,$sUsername,$sPassword,$iPort = 25,$ssl)
_SMS_Send($aSMS,$iNumber,$sService,$sMessage,$sFromName = "XXX")
;~     

exit

    EndSelect
WEnd

so it complys to the new funktion as far as I see maybe I'm just to tired to see the solution. please go on developing this piece of code because i want to see it in action ;)

:edit

ah got the mistake i used the wrong port

Edited by Chaosmeister
Link to comment
Share on other sites

Ok

now

no errorcode everything works fine until it comes to the delivery

i don't get any sms/email on my phone. I am trying both E-plus providers but i only get delivery failure emails at my gmail account

Unfortunately your mail to 00163xxxxxxx@smsmail.eplus.de

couldn't be delivered because the addressee currently doesn't

allow mail reception on their mobile phone.

You may send the mail again. However, a successful

delivery requires that the addressee allows mail reception.

thats all i get Edited by Chaosmeister
Link to comment
Share on other sites

Unfortunately your mail to 00163xxxxxxx@smsmail.eplus.de

couldn't be delivered because the addressee currently doesn't

allow mail reception on their mobile phone.

You may send the mail again. However, a successful

delivery requires that the addressee allows mail reception

Guessing you just have to enable mail reception with your phone service provider. I know for t-mobile which I have, I had to change a setting on my account online to allow it. Good luck finding it and enabling it.

Link to comment
Share on other sites

  • 8 months later...
  • 6 months later...

Global Const $EUROTEL_CZECH_REPUBLIC = "ccaan@sms.eurotel.cz"

should be

Global Const $O2_CZECH_REPUBLIC = "n@sms.eurotel.cz"

Global Const $O2_CZECH_REPUBLIC = "00420n@sms.eurotel.cz"

Global Const $O2_CZECH_REPUBLIC = "+420n@sms.eurotel.cz"

Global Const $O2_CZECH_REPUBLIC = "n@sms.cz.o2.com"

all variants now tested and work fine

Link to comment
Share on other sites

  • 2 weeks later...

I get error:

### COM Error ! Number: 80020009 ScriptLine: 396 Description:The transport failed to connect to the server.

Line 396 is:

$objEmail.Send

$server = "smtp.gmail.com"
$email = "juvigy@gmail.com"
$username = "juvigy@gmail.com" ;tried also $username = "juvigy"
$password = "pass"
$port = 465
$ssl = 1

$number = 0887915998
$service = $MTEL_BULGARIA
$message = "Hello, This is an AutoIT SMS"
$message2 = "Yep..."
Link to comment
Share on other sites

I get error:

### COM Error ! Number: 80020009 ScriptLine: 396 Description:The transport failed to connect to the server.

Line 396 is:

$objEmail.Send

This error is exactly what it is describing. A failure to send the sms (email) over smtp to the gmail server due to a failure to connect. What's strange is the settings you have entered appear to be correct for gmail so I can't really direct you other than these few guesses below... (these are complete guesses)

1. make 100% sure your smtp settings are correct

2. make sure gmail doesn't require you to toggle something on to allow smtp access (don't have a gmail account so I don't know if this is the case)

3. if you have a firewall, make sure it is not blocking outbound traffic on your smtp port, or even try disabling it to see.

possible testing options

1. try to send an smtp message with the same account through a program like outlook or another smtp client

Good Luck, Hopefully you can get it working.

DisabledMonkey

Link to comment
Share on other sites

  • 2 years later...

When I try to use this now I am getting the following. 

"C:\Program Files (x86)\AutoIt3\Include\SMS.au3"(377,15) : error: missing separator character before keyword.
    $objEmail.To
~~~~~~~~~~~~~~^

Here is the line that is giving the problem:

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
    Local $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress; <----------------------------------------------------------------- Here is the problem

Please help.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

  • Developers

Search is your friend as this is now reported many times.

Update your au3check to the beta version available either from the beta installer or here.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 1 month later...

Hello everyone.

First, sorry for mistakes, I'm french


I've a "little" problem with my script.
Here is it :
 

#AutoIt3Wrapper_Run_AU3Check=n
#include "SMS.au3"

$server = "smtp.gmail.com"
$email = "autoit.projets@gmail.com"
$username = "autoit.projets@gmail.com"
$password = "xxxx"
$port = 465
$ssl = 1

$number = xxxx
$service = $T_MOBILE
$message = "Hello, This is an AutoIT SMS"
;~ $message2 = "Yep..."

$sms = _SMS_Start($server,$email,$username,$password,$port,$ssl)
_SMS_Send($sms,$number,$service,$message) 

 
This script sends the message.
But I received an email on my gmail account, with subject "Delivery Status Notification (failure)", saying :
 

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain tmomail.net  by mm3.tmomail.net 
 
The error that the other server returned was:
550 5.1.1 User Unknown

 

I think i must change the content from $service.
Or the address http://mm3.tmomail.net/ has become obsolete
 
I'm lost, I don't know what to do.
 
Can you help me, please.
Thanks by advance.
 
Have a nice day / evening.
 

=========

Just for information

 

When I try to use this now I am getting the following. 

"C:\Program Files (x86)\AutoIt3\Include\SMS.au3"(377,15) : error: missing separator character before keyword.
    $objEmail.To
~~~~~~~~~~~~~~^

Here is the line that is giving the problem:

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
    Local $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress; <----------------------------------------------------------------- Here is the problem

Please help.

 

By writting this line in first, There isn't more error.

#AutoIt3Wrapper_Run_AU3Check=n

Find on french forum ^^
 
Best regards,
Thomas.

Link to comment
Share on other sites

  • 3 years later...

I just started using this UDF to send alerts to my ATT phone number and I am unable to get anything to display in the message portion of the alert.

$service = $ATT_WIRELESS
$subject = "There is a high priority ticket"
$from = "Test"

$sms = _SMS_Start($server,$email,$username,$password,$port,$ssl)
_SMS_Send($sms,$number,$service,$subject,$from)

I am seeing

FRM: xxxxx

SUBJ: xxxxxxx

MSG: [blank]

Link to comment
Share on other sites

'mobile carrier SMS gateway'  is all the keywords i can think of.  maybe check this list too:

https://github.com/mfitzp/List_of_SMS_gateways/blob/master/legacy.md

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...