''' This program was written to send one string of text as numerous text messages through a gmail account. THIS REQUIRES A GMAIL ACCOUNT FOR THIS TO WORK. Also make sure there is a providers file in the same folder as gmail.py and annoy.py The information needed for the providers.txt file can be found at: https://en.wikipedia.org/wiki/List_of_SMS_gateways An example of the format of the providers.txt: att=@txt.att.net To correctly use the GUI, just hit enter after you have filled in the text box. After enter is pressed on the last text box, the program will run, and once it is finished the GUI will close. ''' #imports needed for mail() import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText #imports needed for the GUI import wx #setting up variables userItems=[] items=[] userInfo=[] service={} class getUserData(wx.Frame): """ Get the information to send a text """ def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title, size=(300,300)) menuBar=wx.MenuBar() first=wx.Menu() second=wx.Menu() first.Append(wx.NewId(),'New Window','This is a new Window') first.Append(wx.NewId(),'Open...','This opens a new menu') menuBar.Append(first,'File') menuBar.Append(second,'Edit') self.SetMenuBar(menuBar) #Close window when X is pressed self.Bind(wx.EVT_CLOSE, self.closewindow) # create the main sizer self.mainSizer = wx.BoxSizer(wx.VERTICAL) # Add a panel so it looks the correct on all platforms self.panel = wx.Panel(self, wx.ID_ANY) self.lbls = ["Number:", "Provider:", "Number of text to be sent:","Message:"] for lbl in self.lbls: self.buildLayout(lbl) self.panel.SetSizer(self.mainSizer) self.Center() #Centers the window self.Show() def closewindow(self, event): self.Destroy() def buildLayout(self, text): """""" lblSize = (160,-1) lbl = wx.StaticText(self.panel, label=text, size=lblSize) self.text=text txt = wx.TextCtrl(self.panel,style=wx.TE_PROCESS_ENTER) txt.Bind(wx.EVT_TEXT_ENTER, self.txtControl, txt) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(lbl, 0, wx.ALL|wx.ALIGN_LEFT, 5) sizer.Add(txt, 0, wx.ALL, 5) self.mainSizer.Add(sizer) def txtControl(self,event): item=event.GetString() items.append(item) if len(items)==4: try: service[items[1]] except KeyError: print "No such service provider in file" #defining the variables to make them easier to work with number=int(items[0]) provider=str(items[1]) count=int(items[2]) message=str(items[3]) email='%d%s' %(number,service[provider]) i=0 while i