I can send an email from my Rails app, but not an SMS text through the mail gateway
I have an application that needs to send emails and sms text messages. It only sends emails ok, but when I try to send text messages using mail gateways (for verizon, xxxyyyzzzz@vtext.com ) I get nothing. I was rewriting the phone using an email gateway using my gmail account, so I know it works. I would just think that from the point of view of my application, I am just sending another email. Any idea why this isn't working? Or what can I do to troubleshoot?
I should also point out that I am doing this from a Rails application on my local machine ... not in a way that matters.
a source to share
Verizon can perform reverse DNS lookup as a simple spam check. Your provider information may be displayed during this search instead of the return address information that your email contains and therefore may be blocked.
To fix the problem, make sure the returned email address you are using comes from your ISP's email account.
a source to share
Here's how to debug it on Linux. Start the Rails app server with strace:
strace -s99999 -e connect,read,write,close -o strace.log script/server
Then go through strace.log
and see which SMTP server the Rails application connects to, and what it reads and writes.
Then do the same with your favorite email client (recommended: mutt because Thunderbird is slower in strace).
Try sending exactly the same bytes from Rails that your email client sends.
a source to share
I wrote a Ruby client application to send SMS, see http://freebiesms.blogspot.com/2009/07/send-free-sms-from-ruby.html for full source code download.
Hello
Dan