0

I'm using the following code to send an outbound SMS message from Twilio:

from twilio.rest import Client

account_sid = '<ACCOUNT SID>'
auth_token  = '<AUTH TOKEN>'

client = Client(account_sid, auth_token)

message = client.messages.create(to='<To mobile number>',
                                 from_='<Twilio phone number>',
                                 body='Stackoverflow is awesome!')

print('Message ID: ' + message.sid)

The code worked fine for my mobile number i.e. the messages are received on my phone and the Programmable Messaging Log shows the status Delivered. All good!

However, some of my friends/colleagues couldn't receive messages on their phones. When I checked the Programmable Messaging Logs, it shows the status Sent (and not Delivered). I couldn't figure out the possible issue and a working solution to this problem.

Any guidance will be really appreciated.

2
  • Just to confirm, were those numbers added to your twilio account? Commented Sep 22, 2021 at 7:10
  • Yes @BhagyeshDudhediya! I have added those numbers in the Verified Caller IDs list. Commented Sep 22, 2021 at 7:22

1 Answer 1

2

The issue is resolved.

The Sent status of the messages that were not delivered eventually turned to Undelivered (Error: 30008) Unknown error. I went through this page and read about possible solutions to resolve Error 30008. Eventually, I figured out that I was using an exclamation mark (!) in the body text that was causing the problem. I removed the exclamation mark and the SMS was delivered successfully.

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

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.