I am trying to work for sending sms from gmail using python.
I have tried many solutions but it didnt worked.
I tried to use libgmail but seems to be deprecated. Even I am not able to find how to send sms from gmail to jawwal where as actually gmail sends free sms to jawwal.
My code is:
import libgmail
from TextMessaging import *
sender = Sender(<username>, <password>)
txtM = TextMessage(subject, body)
receiver = Receiver("<phone no>", "Jawwal")
sender.sendMessage(receiver, txtM)
in this, on sender it gives error as expected string or buffer
and for reciever, i dont know whats carrier for jawwal like
CARRIERS = {"Alltel":"alltelmessage.com",
"ATT":"mobile.mycingular.com",
"Rogers":"pcs.rogers.com",
"Sprint":"messaging.sprintpcs.com",
"tMobile":"t-mobile.net",
"Telus":"msg.telus.com",
"Verizon":"vtext.com"}
Kindly give me on any information how to send sms to gmail using python script.
Thanks
Perhaps you would want to use one of these services:
[https://www.twilio.com/sms][1]
[http://www.clockworksms.com/][2]
They provide REST API options.
I know this is an old question, but just posting for someone searching for an answer.
"As of April 1, 2014, sending SMS messages to phone contacts through Google Chat in Gmail was
discontinued for all supported mobile operators."
https://support.google.com/chat/answer/112176?hl=en
I think the carrier's email address for your phone is as such:
jawwal.com.country_code
Replace country_code with the appropriate URL extension (.sa, .lb, etc.).
Related
I wrote a python script that sends an html email that includes texts and images. I can view e-mail perfectly in gmail through gmail app or dekstop browser but images got distorted when I open it in my native iphone e-mail client(not with gamil but with my hotmail account, if that matters).
My first question: Is there any way to fix this?
If no, then my second question is: I always see beautiful e-mail campaigns that works in every email clients. How do companies achieve that?
note/ My final code to send the e-mail:
message = MIMEText(text,'html')
message['to'] = all_list
message['from'] = ''
message['subject'] = ""
raw = base64.urlsafe_b64encode(message.as_bytes())
raw = raw.decode()
message = {'raw': raw}
gmail_service.users().messages().send(userId='me', body=message).execute()
As far as I know, email HTML gets parsed differently in every mail client and the way to generate an email template that would look as expected on all of them is based on correct table usage.
If you're interested in learning more about how to do it correctly, read this article.
If you're just looking for a way to make it work, you may assist one of those email template builders:
https://stripo.email/
https://beefree.io/
Number 1 did the trick for me.
Answer to first question: Yes you can fix it but it is tedious and alot of work (or use simple email templates)
Second: Bigger companies use software like Mailchimp or Selligent. They make the mailings and compatible for other devices (emails are really anoying because every client interpret html differently)
Base64 images do not work in Hotmail or Outlook.
The best way to display images in html emails is to host them on a web site and include a link to them in the email. This works on all modern email clients.
example:
<img src="https://via.placeholder.com/170" width="170" height="170" alt="alt_text" border="0">
More Information:
https://www.campaignmonitor.com/blog/email-marketing/2019/04/embedded-images-in-html-email/
In Python I am trying to do 'send a password reset email', javascript reference (https://firebase.google.com/docs/reference/js/firebase.auth.Auth#sendPasswordResetEmail). So far (and only recently) it looks like 'generate password reset link' was added (https://github.com/firebase/firebase-admin-python/releases). Does anyone know the next step in getting the email send? Do we send the email ourselves? If so, any suggestions? Is there a way to send the email in python directly?
Thanks for all your help in advance!
Might be late but for others to see:
email = 'user#example.com'
link = auth.generate_password_reset_link(email, action_code_settings)
# Construct password reset email from a template embedding the link, and send
# using a custom SMTP server.
send_custom_email(email, link)
More in here: https://firebase.google.com/docs/auth/admin/email-action-links#python_1
Thank you (bojeil-google) on Github for providing the answer. Apparently, the way to do this is to make a POST request per https://firebase.google.com/docs/reference/rest/auth/#section-send-password-reset-email . There is no direct call to do this in the python SDK. Thanks again!
Firebase-admin-sdk (python) is lack of methods to deal with user authentication. You can use Pyrebase. It's a wrapper for the firebase API.
I just got started programming a year ago (on and off) and I am trying to save an attachment to a folder offline from my personal GMAIL account.
I was advised to use :
https://developers.google.com/gmail/api/quickstart/python
I set up the
I authenticated the my account and now am trying to get comfortable with this tool.
There are some initial questions that I have
What is User ID ?
is this my email ( tttt#xxxx.xxxx)
or someone else's email (ppppp#yyyy.yyy)
How do I get a email ID's ?
These questions stem from ...
GET https://www.googleapis.com/gmail/v1/users/userId/messages/messageId/attachments/id
from the page :
https://developers.google.com/gmail/api/v1/reference/users/messages/attachments/get
Again I am just learning from a beginner place..
Thanks
Just use "me" as the userId as it says in the doc.
To get a messageId first you have to search (list) messages, using something like:
resp = gmail.users().messages().list(userId="me", q="has:attachment subject:'foo bar' before:"2014-01-05").execute()
you can then iterate through the 'messages' in that resp and
gmail.users().messages().get(userId="me", id=message['id']).execute()
The Gmail API guides are quite helpful, take a look at them, for example:
https://developers.google.com/gmail/api/guides/filtering
I've develop webmail client for any mail server.
I want to implement message conversion for it — for example same emails fwd/reply/reply2all should be shown together like gmail does...
My question is: what's the key to find those emails which are either reply/fwd or related to the original mail....
The In-Reply-To header of the child should have the value of the Message-Id header of the parent(s).
Google just seems to chain messages based on the subject line (so does Apple Mail by the way.)
I'm reading this article : http://code.google.com/intl/zh-CN/appengine/docs/python/mail/receivingmail.html
I'd like to know, is this the right article to read to deal with mail from others sent to me ?
My Gmail is zjm1126#gmail.com, so when someone sends email to zjm1126#gmail.com, can I do something automatically with the incoming mail?
Update:
The article say:
Your app can receive email at addresses of the following form:
string#appid.appspotmail.com
Where do I set this?
is article used to deal with mail from others send to me ?
Yes
and my gmail is zjm1126#gmail.com , so someone send email to zjm1126#gmail.com,i can do something automatically use incoming mail ,yes ?
No (unless you configure GMail to forward it to the address the article tells you to use)
where to set this ???
Nowhere. You are given your appid when you sign up.