If I use this Python code to send "text" only in a text message, everything works correctly.
The Python Bot.py can send text messages from my computer using Ngrok. The Python Bot.py can also send the text message using a virtual server on Pythonanywhere.com
#Send text message only
#create twilio client using the account_sid, auth_token
client = Client(account_sid, auth_token)
message = client.messages.create(
to= from_number, # to phone number
from\_=to_number,# from phone number
body= return_body # return_body is the text to send
)
However, when I use this code to send text and an image url in a text message, the text message is sent to the correct phone number. However, the images are sent to the same phone number, but without the country code in the phone number. The carrier recognizes the messages as two separate text messages and sends the text to +1(886) 555-5555 and the images to 8865555555.
#Sending a text message and image URLs
#create twilio client using the account_sid, auth_token
client = Client(account_sid, auth_token)
message = client.messages.create(
to= from_number, #to phone number
from\_=to_number, # from phone number
body= return_body, # return_body is the text to send
media_url=\['https://www.example.com/images/logo.jpg', 'https://www.example.com/bot/Help-Desk.jpg'\] # send the image Url's
)
Any ideas on how to fix-solve this problem with the image url's being sent to a phone number without the country code?