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.


Saboi

9 posts

Wannabe Geek


#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
freitasm
BDFL - Memuneh
79314 posts

Uber Geek

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

#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]).





Please support Geekzone by subscribing, or using one of our referral links: Quic Broadband (free setup code: R587125ERQ6VE) | Samsung | AliExpress | Wise | Sharesies | Hatch | GoodSync 




NokiaRocks
364 posts

Ultimate Geek

Trusted

  #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.


Saboi

9 posts

Wannabe Geek


  #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



NokiaRocks
364 posts

Ultimate Geek

Trusted

  #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.

freitasm
BDFL - Memuneh
79314 posts

Uber Geek

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

#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.





Please support Geekzone by subscribing, or using one of our referral links: Quic Broadband (free setup code: R587125ERQ6VE) | Samsung | AliExpress | Wise | Sharesies | Hatch | GoodSync 


Saboi

9 posts

Wannabe Geek


  #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

freitasm
BDFL - Memuneh
79314 posts

Uber Geek

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

#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.





Please support Geekzone by subscribing, or using one of our referral links: Quic Broadband (free setup code: R587125ERQ6VE) | Samsung | AliExpress | Wise | Sharesies | Hatch | GoodSync 


 
 
 

Move to New Zealand's best fibre broadband service (affiliate link). Free setup code: R587125ERQ6VE. Note that to use Quic Broadband you must be comfortable with configuring your own router.
NokiaRocks
364 posts

Ultimate Geek

Trusted

  #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.

Saboi

9 posts

Wannabe Geek


  #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



NokiaRocks
364 posts

Ultimate Geek

Trusted

  #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.

freitasm
BDFL - Memuneh
79314 posts

Uber Geek

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

#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.





Please support Geekzone by subscribing, or using one of our referral links: Quic Broadband (free setup code: R587125ERQ6VE) | Samsung | AliExpress | Wise | Sharesies | Hatch | GoodSync 


Saboi

9 posts

Wannabe Geek


  #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

Saboi

9 posts

Wannabe Geek


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

Hi,

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

Thanks.

Saboi

freitasm
BDFL - Memuneh
79314 posts

Uber Geek

Administrator
ID Verified
Trusted
Geekzone
Lifetime subscriber

#69488 4-May-2007 08:05
Send private message

Great to know it's working now!





Please support Geekzone by subscribing, or using one of our referral links: Quic Broadband (free setup code: R587125ERQ6VE) | Samsung | AliExpress | Wise | Sharesies | Hatch | GoodSync 


Create new topic





News and reviews »

Gen Threat Report Reveals Rise in Crypto, Sextortion and Tech Support Scams
Posted 7-Aug-2025 13:09


Logitech G and McLaren Racing Sign New, Expanded Multi-Year Partnership
Posted 7-Aug-2025 13:00


A Third of New Zealanders Fall for Online Scams Says Trend Micro
Posted 7-Aug-2025 12:43


OPPO Releases Its Most Stylish and Compact Smartwatch Yet, the Watch X2 Mini.
Posted 7-Aug-2025 12:37


Epson Launches New High-End EH-LS9000B Home Theatre Laser Projector
Posted 7-Aug-2025 12:34


Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01









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.