I'm creating a PHP Script to save phone numbers in a database if they text a certain word.
For example: If an iPhone on AT&T sends a SMS to "myemail@site.net", and the message has "hello", they are saved into a database.
The problem is that the body of the SMS, what should be "hello", is being stored as an attachment labeled text_0.txt. You can google this issue and it's pretty widespread https://www.google.com/search?q=text_0.txt&oq=text_0.txt&aqs=chrome..69i57j69i61l2&sourceid=chrome&es_sm=93&ie=UTF-8
I'm wondering how I can take the email, once piped, see if it has an attachment, and if so, read it. It's just a basic .txt file.
Thank you in advance.