views:

212

answers:

5

I have application that needs to send emails and sms text messages. It sends emails just fine, but when I try to send text messages using email gateways (for verizon, [email protected]) I get nothing. I have texted the phone using though the email gateway using my gmail account, so I know it works. I would just think that from my app's point of view I am just sending out another email. Any idea why this doesn't work? Or what I can do to troubleshoot it?

I should also note that I am doing this from a Rails app on my local computer...not that it should matter.

+1  A: 

Maybe Verizon has software that can identify emails sent from software rather than humans, and rejects yours?

Try making your software add all the same headers (eg. X-Mailer) that a normal email client would add.

RichieHindle
i dont know....gmail doesn't seem to be setting those headers.
Tony
+1  A: 

Verizon could be doing a reverse DNS query as a simple spam check. Your ISP's info could show up during this look up instead of the return address info that your email message contains, and thus could be getting blocked.

To troubleshot this make sure that the return e-mail address that you are using is coming from an ISP e-mail account.

Richard West
A: 

Here is how to debug it on Linux. Run your Rails application server with strace:

strace -s99999 -e connect,read,write,close -o strace.log script/server

Then examine strace.log and see exactly which SMTP server the Rails application connects to, and what it reads and writes.

Then do the same with your favorite mail client (recommended: mutt, because Thunderbird is slow in strace).

Try to send exactly the same bytes from Rails what your mail client sends.

pts
A: 

I have used SMS_Fu in the past to send out text messages. It has worked wonderfully.

vrish88
A: 

Hi,

I have written a client app for Ruby for sending SMS, please see http://freebiesms.blogspot.com/2009/07/send-free-sms-from-ruby.html to download complete source code.

Regards

Dan