| SMS Gateway · Registration Requirement |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| sdfungayi |
Posted: Feb 5 2010, 08:03 AM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 52 Member No.: 1011 Joined: 18-December 07 |
I want to forward contents of an SMS to mobile phone numbers or email addresses of receipients listed in my database depending on the parameters in the body of the incoming SMS
For example, the following incoming SMS: CONTACT singapore software developers mobile. send me your product list will forward the body of the SMS via email, text message or both to mobile communication software developers in Singapore who are listed in our database I tried the the SMS-to-Email function of the VisualGSM but was only able to forward to receipents only listed in the SMS. I could not incorporate search parameters in the function to choose email addresses or mobile numbers of recepients I am using MySQL 5 |
| admin |
Posted: Feb 8 2010, 06:06 AM
|
|
Administrator ![]() ![]() ![]() Group: Admin Posts: 1074 Member No.: 1 Joined: 5-May 03 |
The SMS-to-Email function only sends to one email address. To send to multiple, you will need to use a script such as PHP - http://www.visualgsm.com/tutorial011_send_sms_php.htm
-------------------- |
| sdfungayi |
Posted: Feb 8 2010, 06:54 AM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 52 Member No.: 1011 Joined: 18-December 07 |
Apparently all the examples refer to sending SMS not email.
I need to know how to send email by selecting email addresses from a table. I have broken down what I want to do into the three steps below. My challenge is Step 3 where I need help. Step 1. Receive SMS Step 2. Select email_addresses and phone_numbers from TABLE where criteria matches SMS parameters Step 3. Send SMS contents via email to all email_addresses and phone_numbers selected in Step 2 I want to use FUL-TEXT SEARCH |
| admin |
Posted: Feb 10 2010, 05:13 AM
|
||||
|
Administrator ![]() ![]() ![]() Group: Admin Posts: 1074 Member No.: 1 Joined: 5-May 03 |
-------------------- |
||||
| sdfungayi |
Posted: Feb 13 2010, 01:50 PM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 52 Member No.: 1011 Joined: 18-December 07 |
I adapted the script you suggested. When I run it it sends multiples copies of the same to each recepient. For example, if there are ten (10) emails address in the table, the first email address in the table receives 10 emails, the second gets 9, and the last gets 1.
How do I solve this? Please see the script below. <?php require_once("class.phpmailer.php"); $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "smtp.mailprovider"; // SMTP server $mail->From ="address@email.com"; $mail->FromName = "Lions"; @MYSQL_CONNECT("localhost","root",""); @mysql_select_db("vgsmdb"); $query = "SELECT * FROM studentsemails"; $result = @MYSQL_QUERY($query) or die(mysql_error()); while ($row = mysql_fetch_array ($result)) { $mail->AddBCC($row["Email"]); $mail->Subject = "Test Email Message"; $mail->Body = "Test: This is my first email sent through"; if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent.'; } } ?> |
![]() |
![]() ![]() ![]() |