SMS to email

SMS to email SearchSearch
Author Message
Zahoor Ahmed
New member
Username: Zahoor

Post Number: 1
Registered: 04-2011
Posted on Thursday, April 14, 2011 - 07:41 am:   

Hello
I have downloaded a now sms, it works properly and send and receive messaged from my phone. But I can send SMS to an email using mailto: executing in 2-way option. I have no mail server, can I use my gmail account to send sms to an email or my personal domain. Please guide me I have no proper knowledge of mail server.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3101
Registered: 08-2008
Posted on Thursday, April 14, 2011 - 08:58 pm:   

Hi,

Unfortunately the mailto: 2-way command is not going to work in that configuration.

The problem is that the function assumes a dynamic sender address of phonenumber@domain. It is assuming that NowSMS can operate as an SMTP mail server.

If you want to send via GMail, you have to use your e-mail address as the sender. That type of model using a single e-mail address is different. We are looking at various ways to support this in the future, but as it exists today, the mailto: feature will not work properly in the environment that you describe.

As an alternative, if you're familiar with PHP, you could write a PHP script to send e-mail, and configure NowSMS to call the PHP script. I'm sorry that there is not an easier way.

--
Des
NowSMS Support
Zahoor Ahmed
New member
Username: Zahoor

Post Number: 2
Registered: 04-2011
Posted on Friday, April 15, 2011 - 08:37 am:   

Thanks for reply. I can write simple php mail function but where to include. Further more how I use single email (sender) and where I should configure that email. Is there any tutorial available?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3103
Registered: 08-2008
Posted on Friday, April 15, 2011 - 03:52 pm:   

There's a good simple example of passing parameters from a 2-way command to a PHP script here: http://support.nowsms.com/discus/messages/1/3991.html
Zahoor Ahmed
New member
Username: Zahoor

Post Number: 3
Registered: 04-2011
Posted on Sunday, April 17, 2011 - 03:45 pm:   

Thanks for all for continuous support. I tried my best but command could not be executed.
Please see screen shots.
Image 1
http://cttsol.com/sms/service.JPG
NowSMS works properly sends and receive SMS

I have uploaded php script to my hosting.
http://cttsol.com/sms/2way.php
Image 2
http://cttsol.com/sms/command.JPG
Issued command as
http://cttsol.com/sms/2way.php?sender=@@SENDER@@&message=@@FULLSMS@@
* in prefix
but nothing happens. :)
I tried my best to download sms in outlook using tutorial but failed
Image 3
http://cttsol.com/sms/sms.JPG
(Setting MMSC)
Configured outlook express as
Email zahoor@sms.domain.name (zahoor user name in SMS Now)
pop3 : 192.168.1.2 (Local IP)
SMTP: 192.168.1.2
My system is not part of any network.
SMTP Port : 25
POP: 110
Kindly help me after seeing screen shots and solve my problems.
Zahoor Ahmed
New member
Username: Zahoor

Post Number: 4
Registered: 04-2011
Posted on Sunday, April 17, 2011 - 04:51 pm:   

After troubleshooting I can send sms from my outlook express but cant receive sms there. Any guideline to read sms in outlook express.
Zahoor Ahmed
New member
Username: Zahoor

Post Number: 5
Registered: 04-2011
Posted on Sunday, April 17, 2011 - 08:55 pm:   

My outlook issue has been resolved but only one problem is unsolved that is to execute php script or mailto:
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3107
Registered: 08-2008
Posted on Monday, April 18, 2011 - 02:26 pm:   

Receiving the SMS in an e-mail client is mutually exclusive from any 2-way command scripts.

In other words, it is either/or.

If the received SMS is getting routed to a local user account, then it will not be routed to a 2-way command script.
Zahoor Ahmed
New member
Username: Zahoor

Post Number: 9
Registered: 04-2011
Posted on Friday, May 06, 2011 - 09:32 pm:   

mailto: command does not work. I checked echo command it works and sends message back to sender.
What is wrong with mailto? Received SMS is not routed to any local user.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3156
Registered: 08-2008
Posted on Friday, May 06, 2011 - 10:39 pm:   

As I mentioned in the first reply on this thread, the mailto: command assumes that NowSMS is configured to operate as a mail server.

It is not likely to work in the original configuration that you described.

If you enable the MMSCDEBUG.LOG, you will see NowSMS attempting to perform DNS MX record lookups to send the message, and possibly even connecting to a destination server to deliver the message. However, any messages sent will likely end up in a spam filter, or rejected in the configuration that you describe.

That is why I suggested a PHP mail script instead.

Here is an example that I wrote to function as a 2-way command named email.php:

http://www.nowsms.com/download/email-php.txt

You need to edit the script to include your GMail username/password and e-mail address.

The script connects to GMail to send any messages.

Assuming the script is named email.php, an example 2-way command format for it would be:

http://server/email.php?sender=@@SENDER@@&text=@@FULLSMS@@

I hope this helps.

Note that this command does require that the PHP PEAR Mail package be installed, but that does seem to be widely installed on various hosting providers.

The following article also explains how to configure your own local copy of PHP, including the PEAR Mail package: http://www.nowsms.com/now-sms-native-php-scripts

--
Des
NowSMS Support
Zahoor Ahmed
New member
Username: Zahoor

Post Number: 10
Registered: 04-2011
Posted on Saturday, May 07, 2011 - 09:35 am:   

Thanks to reply. I tried but require_once(Mail.php) is missing. Where to find mail.php?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3157
Registered: 08-2008
Posted on Saturday, May 07, 2011 - 01:58 pm:   

The PEAR Mail package is not installed (and possibly PEAR itself).

If this is on a web host provider, you'd have to talk to them about it.

If you control the PHP installation, the article that I referenced at the end of the previous post explains PHP installation with PEAR and the Mail package.

(For more on PEAR, see http://pear.php.net)