Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion regarding usage of API. #3

Closed
Moondra opened this issue May 1, 2018 · 2 comments
Closed

Confusion regarding usage of API. #3

Moondra opened this issue May 1, 2018 · 2 comments

Comments

@Moondra
Copy link

Moondra commented May 1, 2018

I'm trying to receive text-messages to my phone via Python scripts as well as send messages to a friend.
I am currently using Verizon as my wireless provider, and my friend is actually in Japan.

I'm a little confused as to the process via PySMS and what is needed to do this.

Do I need an e-mail account as well a wireless account( Verizon) to do this?
I'm looking at the code below and confused about some parameters:

ps = PySMS.PySMS(address="text@example.com", password="password", smtp_server="smtp.example.com", smtp_port="465", ssl=True)

address = email adddress like gmail?
What about smtp_server? What would I need here?

As for this line:
ps.add_number("5551231234", "att")

I have verizon so would I just enter my phone number and "verizon" or maybe "vz" or
do I need to create a Vtext account?

First time using Python (or any other language) to send messages, so I'm lacking knowledge in basic terminology.

@clayshieh
Copy link
Owner

smtp_server refers to the smtp server that you want to use to send the emails and imap_server refers to the imap server that you want to use to check the emails. address and password is the login for the said servers. Typically, email accounts have IMAP and SMTP servers settings that allow you to use 3rd party mail clients so you could get the settings you need for your specific email from the settings page or you could also see the configured SMTP/IMAP settings on your 3rd party client such as OSX mail app. The only thing you need to use this api and text people would be an email account.

You could follow the steps below to get this working for a gmail account and send a text to a verizon number:

  1. Create a gmail account with the username text_moondra@gmail.com and a password 123456
  2. ps = PySMS.PySMS(address="text_moondra@gmail.com", password="123456", smtp_server="smtp.gmail.com", smtp_port="587", ssl=True)
  3. ps.add_number("5551231234", "verizon")
  4. ps.text("Test text")

steps 2-4 should be put into a separate file in the same directory as PySMS.py so for example you would create a file called test_text.py with the following code

import PySMS

ps = PySMS.PySMS(address="text_moondra@gmail.com", password="123456", smtp_server="smtp.gmail.com", smtp_port="587", ssl=True)
ps.add_number("5551231234", "verizon")
ps.text("Test text")

Let me know if you have any issues!

@Moondra
Copy link
Author

Moondra commented May 3, 2018

Thank you. I would add this to the README as it is very helpful for beginners such as myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants