Skip to content

Instantly share code, notes, and snippets.

@alexle
Last active December 1, 2023 01:01

Revisions

  1. alexle revised this gist Mar 28, 2013. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions pythonsms.py
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,15 @@
    # sms.py
    # Sends sms message to any cell phone using gmail smtp gateway
    # Written by Alex Le

    import smtplib

    # Use sms gateway provided by mobile carrier:
    # at&t: number@mms.att.net
    # t-mobile: number@tmomail.net
    # verizon: number@vtext.com
    # sprint: number@page.nextel.com

    # Establish a secure session with gmail's outgoing SMTP server using your gmail account
    server = smtplib.SMTP( "smtp.gmail.com", 587 )

  2. alexle created this gist Oct 18, 2011.
    11 changes: 11 additions & 0 deletions pythonsms.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    import smtplib

    # Establish a secure session with gmail's outgoing SMTP server using your gmail account
    server = smtplib.SMTP( "smtp.gmail.com", 587 )

    server.starttls()

    server.login( '<gmail_address>', '<gmail_password>' )

    # Send text message through SMS gateway of destination number
    server.sendmail( '<from>', '<number>@tmomail.net', '<msg>' )