0

I am following a Twilio guide to be able to send an SMS message from my Twilio phone number to my personal phone number, and for some reason, I am not receiving a message from my Twilio phone number when I run this code:

from twilio.rest import Client

account_sid = ACCOUNT_SID
auth_token = AUTH_TOKEN
client = Client(account_sid, auth_token)

message = client.messages \
    .create(
        body='Success!',
        from_=TWILIO_NUMBER,
        to=MY_NUMBER
    )
print(message.sid)

Where ACCOUNT_SID, AUTH_TOKEN, TWILIO_NUMBER, and MY_NUMBER are strings with the proper values. I was following this guide: https://www.twilio.com/docs/sms/send-messages . Thanks! EDIT - Attached is a picture of my account permissions from the dashboard page. Does this mean that I have to pay to send an SMS message from my Twilio phone number to my personal phone number?: enter image description here

6
  • With a free account you can send SMS messages to numbers that you have verified with your Twilio account. Your code looks correct, do you get an error when you try to run it? Or do you see an error in the Twilio debugger at all? Commented Jun 28, 2021 at 3:37
  • No, there is no error, and the message.sid is printed out. I'm just not receiving the SMS message. Commented Jun 29, 2021 at 0:25
  • What is the status of the message in the Message Logs? Commented Jun 29, 2021 at 4:16
  • Thank you @philnash . I looked in the Message Logs and when I try to send the message, I am getting an "(Error: 30007) Message filtered Your message content was flagged as going against carrier guidelines." It looks like my message was identified as spam because I tried to send the same message a ton of times. Commented Jul 1, 2021 at 2:39
  • According to this guide: support.twilio.com/hc/en-us/articles/… , if you collect 3 or more examples of Message SIDs that have the “undelivered” status with error 30007, and then contact the Twilio Support team, they can review your messaging and determine if an error was made. So that's what I did; hopefully they get back with me soon so I can start sending messages again! Commented Jul 1, 2021 at 3:14

3 Answers 3

2

One Check that ACCOUNT_SID, AUTH_TOKEN are correct or not because it gets updated if we not used for few days otherwise all is okk !! Also Check for that you have Credit or not to send message.

Sign up to request clarification or add additional context in comments.

2 Comments

Ok I just checked and my ACCOUNT_SID and AUTH_TOKEN are correct. I just added a picture of my account permissions from the dashboard page to the question. From this picture, does this mean that I have to upgrade my account to send an SMS message from my Twilio phone number to my personal phone number? I am confused because in the past, I have been able to send SMS messages from my Twilio phone number to my personal phone number for free. Has Twilio policy changed?
Dont do any extra settings becuase other settings may required charges or premimum membership I think thats the reason not working. I think you can use alternatives like fas2sms.com I hope this will help you .
0

Kindly send a message [START] from your phone to your Twilio number. If you might send a [STOP] message from your phone to twilio number.

Comments

0

This is what showed up in the Message Logs whenever I tried to send the message: "(Error: 30007) Message filtered Your message content was flagged as going against carrier guidelines." According to this guide:
https://support.twilio.com/hc/en-us/articles/223181848-How-Does-Message-Filtering-Work- , if you collect 3 or more examples of Message SIDs that have the “undelivered” status with error 30007, and then contact the Twilio Support team, they can review your messaging and determine if an error was made. Thanks for the help guys!

EDIT -- Twilio support got back to me, and apparently my messages were getting filtered (and thus getting the error 30007) because my carrier for my personal phone number is Sprint, and according to Twilio support, messages to T-Mobile (including Sprint) phone numbers may get filtered because they have not launched their A2P 10DLC solution. Other carriers like Verizon and AT&T have already launched their A2P 10DLC solutions, so this issue does not occur if the carrier of your personal phone number is Verizon or AT&T. But again, this issue might occur if your carrier is T-Mobile or Sprint.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.