Sign in to follow this  
Followers 0
LimeSeed

Best SMS Sender yet!

39 posts in this topic

This is the easiest to use and best sms sender yet! it supports mms for verizon and at&t. How would i get it so that the text under the edit refreshes every so often but does not flicker?

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=SMS.ico
#AutoIt3Wrapper_outfile=SMS.exe
#AutoIt3Wrapper_Res_Comment=By: Isaac Flaum
#AutoIt3Wrapper_Res_Description=Allows computer to send SMS messages to phones
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Isaac Flaum 2008
#AutoIt3Wrapper_Res_Language=1033
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GuiScrollBars.au3>
#include<file.au3>
#include<misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ScrollBarConstants.au3>
#include <EditConstants.au3>
$s_SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED
$s_FromName = "" ; name from who the email was sent
$s_FromAddress = "" ;  address from where the mail should come
$s_ToAddress = "" ; destination address of the email - REQUIRED
$s_Subject = "" ; subject from the email - can be anything you want it to be
$as_Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail
$s_AttachFiles = "" ; the file you want to attach- leave blank if not needed
$s_CcAddress = "" ; address for cc - leave blank if not needed
$s_BccAddress = "" ; address for bcc - leave blank if not needed
$s_Username = "" ; username for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$s_Password = "" ; password for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$IPPort = 465 ; port used for sending the mail
$ssl = 1 ; enables/disables secure socket layer sending - put to 1 if using httpS

Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
GUICreate("SMS", 160, 180)
$send = GUICtrlCreateButton("Send", 5, 150, 150, 25)
$phonenum = GUICtrlCreateLabel("Phone Number:", 5, 5, 80, 20)
$phonesubject = Guictrlcreatelabel("Subject:", 5, 30, 80, 20)
$subject = guictrlcreateinput("", 50, 30, 105, 20)
guictrlsetstate(-1, $GUI_DISABLE)
$to = GUICtrlCreateInput("", 85, 5, 70, 20)
$attatchment = GUICtrlCreateButton("Attatchment", 5, 55, 80, 20)
$carrier = GUICtrlCreateCombo("Carrier", 90, 55, 65, 20)
GUICtrlSetData(-1, "Verizon|AT&T|Sprint|T-Mobile", "Carrier")
$numchar = GUICtrlCreateLabel("Characters Left: 160", 5, 130, 100, 20)
$txt = GUICtrlCreateEdit("", 5, 85, 150, 40, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
guisetbkcolor(0x99cc66)
GUISetState(@SW_SHOW)
While 1
    sleep(10)
    $msg = GUIGetMsg()
    $readtxt = GUICtrlRead($txt)
$length = StringLen($readtxt)
$actualchar = Execute(160 - $length)
GUICtrlSetData($numchar, "Characters Left: " & $actualchar)
    Select
        Case ($msg = $attatchment)
            $s_AttachFiles = FileOpenDialog("Attatchment", @DesktopDir, "Files (*.mid;*.gif;*.jpg;*.mp3)")
            guictrlsetstate($subject, $GUI_ENABLE)
        Case ($msg = -3)
            Exit
        Case ($msg = $send)
            $s_Subject = guictrlread($subject)
            $as_Body = GUICtrlRead($txt)
            $s_ToAddress = GUICtrlRead($to)
            $wacarrier = GUICtrlRead($carrier)
            Select
                Case ($wacarrier = "Verizon")
                    If $s_AttachFiles = "" Then
                        $s_ToAddress = $s_ToAddress & "@vtext.com"
                    Else
                        $s_ToAddress = $s_ToAddress & "@vzwpix.com"
                    EndIf
                Case ($wacarrier = "AT&T")
                    If $s_AttachFiles = "" Then
                        $s_ToAddress = $s_ToAddress & "@txt.att.net"
                    Else
                        $s_ToAddress = $s_ToAddress & "@mobile.att.net"
                    EndIf
                Case ($wacarrier = "Sprint")
                    If $s_AttachFiles = "" Then
                        $s_ToAddress = $s_ToAddress & "@messaging.sprintpcs.com"
                    Else
                        $s_ToAddress = $s_ToAddress & "@messaging.sprintpcs.com"
                    EndIf
                Case ($wacarrier = "T-Mobile")
                    If $s_AttachFiles = "" Then
                        $s_ToAddress = $s_ToAddress & "@tmomail.net"
                    Else
                        $s_ToAddress = $s_ToAddress & "@tmomail.net"
                    EndIf
            EndSelect
            $sendprog = ProgressOn("Sending", "Sending Message...")
            $rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
            If @error Then
                MsgBox(0, "Error sending message", "Error code:" & @error & "  Rc:" & $rc)
            EndIf
            
        EndSelect
    
WEnd

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
    ProgressSet(10)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    ProgressSet(20)
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    ProgressSet(30)
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then
        $objEmail.HTMLBody = $as_Body
    Else
        $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
        Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
        For $x = 1 To $S_Files2Attach[0]
            $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x])
            If FileExists($S_Files2Attach[$x]) Then
                $objEmail.AddAttachment($S_Files2Attach[$x])
            Else
                $i_Error_desciption = $i_Error_desciption & @LF & 'File not found to attach: ' & $S_Files2Attach[$x]
                SetError(1)
                Return 0
            EndIf
        Next
    EndIf
    ProgressSet(40)
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
    ProgressSet(60)
    ;Authenticated SMTP
    If $s_Username <> "" Then
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    If $ssl Then
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
    ProgressSet(80)
    ;Update settings
    $objEmail.Configuration.Fields.Update
    ; Sent the Message
    $objEmail.Send
    If @error Then
        SetError(2)
        Return $oMyRet[1]
    EndIf
    ProgressSet(100)
    ProgressOff()
EndFunc   ;==>_INetSmtpMailCom
;
;
; Com Error Handler

global $warming = true

Share this post


Link to post
Share on other sites



This is the easiest to use and best sms sender yet! it supports mms for verizon and at&t. How would i get it so that the text under the edit refreshes every so often but does not flicker?

Replace

GUISetState(@SW_SHOW)
While 1
    sleep(10)
    $msg = GUIGetMsg()
    $readtxt = GUICtrlRead($txt)
$length = StringLen($readtxt)
$actualchar = Execute(160 - $length)
GUICtrlSetData($numchar, "Characters Left: " & $actualchar)oÝ÷ Û­«­¢+Ù¥´ÀÌØíÉÑáаÀÌØíÑÕ±¡È)U%MÑMÑÑ¡M]}M!=¤()]¡¥±Ä((ÀÌØíµÍôU%Ñ5Í ¤()%ÀÌØíÉÑáбÐìÐìU%
ÑɱI ÀÌØíÑáФQ¡¸(ÀÌØíÉÑáÐôU%
ÑɱI ÀÌØíÑáФ($ÀÌØí±¹Ñ ôMÑÉ¥¹1¸ ÀÌØíÉÑáФ(ÀÌØíÑÕ±¡ÈôÄØÀ´ÀÌØí±¹Ñ (%U%
ÑɱMÑÑ ÀÌØí¹Õµ¡È°ÅÕ½Ðí
¡ÉÑÉÌ1ÐèÅÕ½ÐìµÀìÀÌØíÑÕ±¡È¤)¹%

So, how does it work? Talk about it.

... please talk


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Replace

GUISetState(@SW_SHOW)
While 1
    sleep(10)
    $msg = GUIGetMsg()
    $readtxt = GUICtrlRead($txt)
$length = StringLen($readtxt)
$actualchar = Execute(160 - $length)
GUICtrlSetData($numchar, "Characters Left: " & $actualchar)oÝ÷ Û­«­¢+Ù¥´ÀÌØíÉÑáаÀÌØíÑÕ±¡È)U%MÑMÑÑ¡M]}M!=¤()]¡¥±Ä((ÀÌØíµÍôU%Ñ5Í ¤()%ÀÌØíÉÑáбÐìÐìU%
ÑɱI ÀÌØíÑáФQ¡¸(ÀÌØíÉÑáÐôU%
ÑɱI ÀÌØíÑáФ($ÀÌØí±¹Ñ ôMÑÉ¥¹1¸ ÀÌØíÉÑáФ(ÀÌØíÑÕ±¡ÈôÄØÀ´ÀÌØí±¹Ñ (%U%
ÑɱMÑÑ ÀÌØí¹Õµ¡È°ÅÕ½Ðí
¡ÉÑÉÌ1ÐèÅÕ½ÐìµÀìÀÌØíÑÕ±¡È¤)¹%

So, how does it work? Talk about it.

... please talk

it will work if you type in an account username and password and stmp server in the first part, i just erased my data for obvious reasons!

global $warming = true

Share this post


Link to post
Share on other sites

it will work if you type in an account username and password and stmp server in the first part, i just erased my data for obvious reasons!

go on...

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

I get this error when running...

The requested action with this object has failed.:

$objEmail.Send

$objEmail.Send^ ERROR

Share this post


Link to post
Share on other sites

I get the exact same error as dalisuit!

Share this post


Link to post
Share on other sites

You need to specify credentials (lines 27,28) and smtp server and port. If you use gmail the server and port are already configured.

Share this post


Link to post
Share on other sites

You need to specify credentials (lines 27,28) and smtp server and port. If you use gmail the server and port are already configured.

yea, i just didnt want to put my information in there because i don't want everyone knowing my username and password!


global $warming = true

Share this post


Link to post
Share on other sites

i have a gmail account and i have specified the correct credentials and still error.

Share this post


Link to post
Share on other sites

@LimeSeed; is it so hard to explain how it works?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

@LimeSeed; is it so hard to explain how it works?

where it says $s_FromAddress = "", you need to replace "" with your email

$s_SmtpServer = "smtp.gmail.com" replace with smtp server

$s_Username = "" replace with username

$s_Password = "" replace with password


global $warming = true

Share this post


Link to post
Share on other sites

where it says $s_FromAddress = "", you need to replace "" with your email

$s_SmtpServer = "smtp.gmail.com" replace with smtp server

$s_Username = "" replace with username

$s_Password = "" replace with password

So, if I ask someone how atomic bomb works and that someone says:

where it says press, you need to press

where it says press again, you press again

ok?

and I say ok.

and he says: don't ask me that stupid question again.

and I say ok, sorry... and thanks, now I know how atomic bomb works.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Thanks for the post, though I don't know if one could call that the best SMS text messaging tool out there. Aside from AutoIt's GUI interface options, this could be written in VBScript, VB, or .NET w/ C#/VB. The options with this tool are limited as it doesn't cover worldwide SMS and if you want to support SMS providers not listed, you will have to add more code to the tool, which is ok though if you are a developer/scripter. :)

Too bad Virgin Mobiles not in the list by default >_<

Also wanted to mention some things:

This is a bit inappropriate but you could get the same thing by hacking Google's Send To Phone feature. Just look into the Send To Phone Page's HTML and you can build a form submission script that posts to the Google service. It need not be written in AutoIt only. You can do this with XMLHttpRequest COM object within VBScript or AutoIt script. With this approach you need not know the SMS email format and you can send to whatever service provider Google supports.

For an SMS tool that doesn't require supplying SMTP account credentials, check out mxmail.exe that I developed, available at: http://www.codeproject.com/KB/tips/easysmtpandsms.aspx

It's a command line executable. I had been wanting to build a COM version (which you could use with AutoIt), but don't have the expertise to do that right now. If there are COM component developers here, maybe you can give me some pointers on how to build it.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

--

Edited by AL3X

Share this post


Link to post
Share on other sites

Does this work's for anyone?

It doesn't for me...

No errors... I run it, type phone number and text message, and click send. but the sms just wont arrive to my phone =S

You should first check to see if you can send SMS to your phone from your email account (Yahoo, Gmail, etc.). Based on the code posted here, you can figure out your SMS email address and send to that. If you can't even receive SMS from your email account, then the issue is not with the script but your SMS provider or your email provider.

You could also try my mxmail tool I posted.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

--

Edited by AL3X

Share this post


Link to post
Share on other sites

Here is a complete list of SMS senders maybe it will help you develope it further.

:)

T-Mobile

Format: 10-digit cell phone number @ tmomail.net

Example: 3335551111@tmomail.net

Verizon Wireless

Format: 10-digit cell phone number @ vtext.com

Example: 3335551111@vtext.com

Rogers Wireless

Format: 10-digit cell phone number @ pcs.rogers.com

Example: 3335551111@pcs.rogers.com

Sprint PCS

Format: 10-digit cell phone number @ messaging.sprintpcs.com

Example: 3335551111@messaging.sprintpcs.com

Cingular Wireless

Format: 1 + 10-digit cell phone number @ cingularme.com

Example: 13335551111@cingularme.com

AT&T PCS

Format: 10-digit cell phone number @ mobile.att.net

Example: 3335551111@mobile.att.net

Bell Atlantic

Format: 10-digit cell phone number @ message.bam.com

Example: 3335551111@message.bam.com

Bell Mobility (Canada)

Format: 10-digit cell phone number @ txt.bell.ca

Example: 3335551111@txt.bell.ca

Cellular One

Format: 10-digit cell phone number @ mobile.celloneusa.com

Example: 3335551111@mobile.celloneusa.com

Comcast

Format: 10-digit cell phone number @ comcastpcs.textmsg.com

Example: 3335551111@comcastpcs.textmsg.com

Fido

Format: 10-digit cell phone number @ fido.ca

Example: 3335551111@fido.ca

Telus

Format: 10-digit cell phone number @ msg.telus.com

Example: 3335551111@msg.telus.com

Cricket

Format: 10-digit cell phone number @ sms.mycricket.com

Example: 3335551111@sms.mycricket.com


[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

I think that I'm "lost".

How could I send a sms from my gmail account?

i twould be something like this: (SPA) 0034618xxxxxx@gmail.com ?

No. You send it like this:

from address: myUsername@gmail.com

to address: 0034618xxxxxx@yourMobilePhoneServiceProvider.com (or whatever the SMS address format is)

The from address is already filled in for you if you send an SMS as an email from Gmail web account or from your email client. You just need to know what your SMS address is. If you don't know, you're out of luck.

Edited by daluu

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

--

Edited by AL3X

Share this post


Link to post
Share on other sites

Ok... so... If my operator is "Movistar (Spain)" I should look for the SMTP of this operator, right?

And once found (hipopeticaly founded) I could send free sms to all the phones from this operator?

The term Free is used too loosely here. I'm sure it depends on the senders user plan, and the receivers user plan.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
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
Sign in to follow this  
Followers 0