Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


9 posts

Wannabe Geek


Topic # 13260 1-May-2007 05:25
Send private message

Hi,

I have tried to use the code below to sent an SMS from my website using Clickatell but i am noit getting them.Where do you think am going wrong? Please advice.

<?php

$cell=$_POST["number"];

$message="api_id:xxxxxx\r
user:xxxxxx\r
password:xxxxx\r
to:$cell\r
reply:email@domain\r
text:SMS from Website";

if(mail($to="sms@messaging.clickatell.com",$subject,$message)){echo"Messgae Sent";}

else{echo"Message not sent";}

?>


Create new topic
BDFL - Memuneh
61509 posts

Uber Geek
+1 received by user: 12234

Administrator
Trusted
Geekzone
Lifetime subscriber

Reply # 69009 1-May-2007 07:49
Send private message

Welcome to Geekzone... First make sure your script is actually sending out an e-mail by sending it to yourself. If you don't receive the e-mail then obvious things to look at are smtp server configuration, credentials, etc.

Then make sure you are using the number in the international format, without the + signal and of course without the 0. For a New Zealand number this would be 64 21 [number] (not 64 021 [number]).





362 posts

Ultimate Geek

Trusted

  Reply # 69010 1-May-2007 07:52
Send private message

Saboi: Hi,

I have tried to use the code below to sent an SMS from my website using Clickatell but i am noit getting them.Where do you think am going wrong? Please advice.


$cell=$_POST["number"];

$message="api_id:xxxxxx\r
user:xxxxxx\r
password:xxxxx\r
to:$cell\r
reply:email@domain\r
text:SMS from Website";

if(mail($to="sms@messaging.clickatell.com",$subject,$message)){echo"Messgae Sent";}

else{echo"Message not sent";}

?>



You cant put your mail command inside an "if statement" requirement.




9 posts

Wannabe Geek


  Reply # 69170 2-May-2007 05:15
Send private message

Hello,

Thanks for the replies.

I am actually trying to send the SMS to my self and the international format of numbeering is what i am using.

Am told the mail command cant be in an if requirement.Any idea what i should do especially to also get on-screen confirmation of SMS sent.

Thanks people, i am already enjoying my stay at this forum.

So, whats my way forward?

Saboi

362 posts

Ultimate Geek

Trusted

  Reply # 69177 2-May-2007 07:58
Send private message

$cell=$_POST["number"];
$subject = "A new sms";
$message="api_id:xxxxxx\r
user:xxxxxx\r
password:xxxxx\r
to:$cell\r
reply:email@domain\r
text:SMS from Website";
mail('sms@messaging.clickatell.com', $subject, $message);
echo"Messgae Sent";
?>

Try sending one to yourself using this and see if you get a message.

BDFL - Memuneh
61509 posts

Uber Geek
+1 received by user: 12234

Administrator
Trusted
Geekzone
Lifetime subscriber

Reply # 69182 2-May-2007 08:25
Send private message

Better still, also try sending to a normal email address to be sure the message is leaving your server.

There's no way to debug something like this before confirming that your server is actually sending something out - so make it a non-conditional action (as NokiaRocks suggests) and also try sending to a normal email address.

Once you know it's leaving the server then you can worry about other things.







9 posts

Wannabe Geek


  Reply # 69347 3-May-2007 05:34
Send private message

Hi,

Tried the code but still no SMS on phone.Yes, i have credit and in my Clickatell account it shows 1 message undelivered.Email am getting an identifier number.

Where could i be going wrong?

Thanks.

Saboi

BDFL - Memuneh
61509 posts

Uber Geek
+1 received by user: 12234

Administrator
Trusted
Geekzone
Lifetime subscriber

Reply # 69350 3-May-2007 08:00
Send private message

Thanks for the update - now we know the email is going out then since there's a failed SMS in your queue.

I can think of two problems:

In your configuration it is possible to select the routes you want to use. For example SMS to some countries cost more than to other countries and if the route is not select the SMS will not be sent. Some SMS require .5 credit others require 1, 1.5 or 2 credits. Check that you allow those to be sent.

Another thing I can think is that the number you are entering is invalid.

Since this is now sitting on the Clickatell platform I recommend you contact them with the message ID and ask why it wasn't sent. They will tell you the exact reason.





362 posts

Ultimate Geek

Trusted

  Reply # 69351 3-May-2007 08:00
Send private message

change the clickatell email address to your own email address to see if your server is actually sending emails.



9 posts

Wannabe Geek


  Reply # 69438 3-May-2007 19:55
Send private message

Hello today,

My server is ending emails out and also to the clickatell server cause in my account it is actually showing that message was sent but undelivered.Report indicates status is Routing Error.

I am using the right format as was adviced.

As for credit, i have enough of it.

Anymore ideas on the way forward?

I have contacted clickatell and also sent them some message ids and look forward to hearing from them soon.I will let you know their response.

Meanwhile,anything else you advice i consider?

Thanks.

Saboi



362 posts

Ultimate Geek

Trusted

  Reply # 69459 3-May-2007 21:54
Send private message

Sorry, but if your message is getting to clickatell then i'm out of suggestions to fix it.

BDFL - Memuneh
61509 posts

Uber Geek
+1 received by user: 12234

Administrator
Trusted
Geekzone
Lifetime subscriber

Reply # 69464 3-May-2007 22:30
Send private message

Saboi: As for credit, i have enough of it.


If there's a routing error it is related to credits. You may have enough, but if you don't allow messages to some "Profiles" the SMS is not sent.

For example, according to Clickatell, a SMS to Zambia costs 1.5 credits. If your profile does not have 1.5 credit destination checked the SMS will never be sent.


You find this in the Routing Profiles page, in the My Settings section.

Again, if this is not the case, contact Clickatell Support and tell them the MSG ID and they will be able to tell you why the Routing Error.







9 posts

Wannabe Geek


  Reply # 69481 4-May-2007 05:04
Send private message

Hi,

This is very interesting.

The Routing Profilse are all checked.

I have sinced contacted Clickatell with the Message IDs for some of the messages.

Thanks.Will keep you posted on this one.

Saboi



9 posts

Wannabe Geek


  Reply # 69482 4-May-2007 05:32
Send private message

Hi,

Managed.You where right, problem was number format.Left out ZERO.

Thanks.

Saboi

BDFL - Memuneh
61509 posts

Uber Geek
+1 received by user: 12234

Administrator
Trusted
Geekzone
Lifetime subscriber

Create new topic

Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.