When I send an email-to-sms from this CLI script:
$th=array("1360xxxxxxx@tmomail.net","Message","sending myself a text message");
mail("$th[0]","$th[1]","$th[2]");
It works just fine, I usually receive the sms in about 5-7 seconds.
But I have another program that uses this: (right now I'm running it via CLI, but the goal is to cron it)
function textmessage($line) { $th = explode ("~~",$line);
mail("$th[4]","$th[3]","$th[6]");
And I don't receive the message.
I temporarily added this line:
print"number: $th[4] subject: $th[3] message: $th[6]";
So I know the mail message is being formatted/assembled in the right order.
Both scripts are using msmtp via my gmail account. Both show no errors in the msmtp.log, and the message does show up in my gmail sent mail folder.
I've checked everything I know to check: php.ini, msmtprc, my gmail account, and can find no problems. Perhaps I need to add a special header, or maybe \r\n to the variables? I'm beginning to wonder if the problem is with tmomail.net. Living on a fixed income, I really can't afford to use a for-pay sms gateway, so I'm hoping there's a solution to this problem.