The smartphone should be put in the mailbox.
Many models of phones proximity sensor merely detects whether or not the object is in front of it, while the other smartphones, the sensor can determine the distance to the object.
If your sensor only returns 0 or 1, it is possible to reduce its sensitivity, pasted several layers of adhesive tape on him so that he did not react to the nearest wall in the mailbox.
Also you can use any Intent as notification trigger.
For example, you can connect any sensor to the headphone jack, which will close the contacts when a letter dropped, and the phone will think that insert earphones and send SMS.
Trial Version Limitations: Works 14 days after installation.
Pro-version of the program: https://play.google.com/store/apps/details?id=il.mail.newsms