Rogers Email-to-Text Changes...

aryko

New Member
Mar 8, 2005
9
0
1
RE: Rogers Email-to-Text

Icarus,
Your code looks good - of course, you're really just replacing the Rogers front end with your own. :) Two things:
- add a </form> tag after the submit entry
- not sure why you have the onLoad code in the <body> tag, but if it works for you, then cool. :)

- aryko
 

Icarus3000

New Member
Mar 9, 2005
6
0
1
I'm just learning here... after some reading, I see how I could clean up the above code - the onload doesn't really do anything.

One question i have though - is there a way (using just HTML (or maybe javascript)) so that when you submit the form, you are re-directed to another webpage instead of Rogers page, ie: when you click "send message" now, you end up at a dead-end Rogers page. I would like to send the user back to my home page instead, or a page that says "Message sent" or something like that.

Thanks!
Icarus
 

aryko

New Member
Mar 8, 2005
9
0
1
RE: Rogers Email-to-Text

Icarus,
Unfortunately I don't have the time to write the html for it, but you could use an IFRAME or just a set of frames to nest the Rogers code into; if you make the frame small enough, it'd be on the page, but the user wouldn't see it.
- aryko
 

Simon

New Member
Mar 9, 2005
4
0
1
aryko: That didn't fix anything for me.
Code:
Warning: imap_open(): Couldn't open stream {localhost/pop3:110/notls}INBOX in /sms/config.php on line 26.

and I've tried using the site, as opposed to the localhost (even though it's running on the server) but to no avail. I've tried pretty much every combination for it too, but nothing seems to work.

Icarus: I've got a perl script to do pretty much what you want - but beware friend, it is the dirtiest code ever to be created in 10 minutes. http://www.0x90.org/~semen/sms2.pl
 

Simon

New Member
Mar 9, 2005
4
0
1
Well, I figured out the combination. It worked as :
Code:
{mail.domain.org/pop3/notls:110}
.
But now it throws back
Code:
Fatal error: Call to undefined function: curl_init() in /sms/auto.php on line 9
.
and a quick phpinfo shows that as always, the universe is against me. PHP 4.3.10 compiled without cURL. Any simple way around this ? I'm looking into using Snoopy for it, but I have never used PHP before. Any suggestions ?

Edit: Word up. Recompiled it, added curlwrappers and libs and it's working perfectly. This is an awesome script you guys. Thank you very much for making it.
 

aryko

New Member
Mar 8, 2005
9
0
1
RE: Rogers Email-to-Text

Simon,
Glad you worked it out. I'm fixing a few errors in the auto.php script - the 'get' function isn't working properly. Expect a new post on the MSN group shortly.
- aryko
 

Icarus3000

New Member
Mar 9, 2005
6
0
1
Simon:

Cool! Unfortunately, I know even less about Perl than I do about HTML and I don't have a clue as to what I am supposed to do with your script... :oops:

- Icarus
 

Simon

New Member
Mar 9, 2005
4
0
1
Ok. So did the script stop working for anybody else for no apparent reason ?

I think it may be my server, but it was working fine for a few days, until I went to check my screen(1) session and lynx was spitting back:

Alert!: Unexpected network read error; connection aborted.
Can't Access `http://localhost/auto.php'.

It was working fine. Now it's not. Boo. Any clues before I go ravaging the server?
 

aryko

New Member
Mar 8, 2005
9
0
1
RE: Rogers Email-to-Text

Still working for me, Simon.
I can't for the life of me figure out how to remove line feeds from messages, and that's what's screwing up the 'get' command for me.
a.
 

aryko

New Member
Mar 8, 2005
9
0
1
RE: Rogers Email-to-Text

Fixed the 'get' command... yay. New version on msn group.
 

rex_and123

New Member
May 11, 2005
1
0
1
Toronto
I had the same problem, I used to subscribe to many alerts from Yahoo and other services, but since Rogers made this change to 'prevent spam', alerts are a pain to get. I would get alot of alerts every day, initially I wanted to bail on Rogers and switch to someone else, but then thought that everyone will go this way.

Recently found this site, it seems to do the job, they send SMS messages to the phones and works well - www.textspin.com. I've been using it for a little while and no complaints.

it'll be interesting to see if Rogers makes the same restrctions with Fido now that they've bought them out.

perhaps we should complain against Rogers to the CRTC!!??
 

ragingtory

New Member
May 11, 2005
1
0
1
I get this message when I go to run the auto.php through the server. It looks like there's something wrong with the code - but it could be a server side issue. I'm using v 4 from the msn group.

/home/<username>/public_html/sms/auto.php: line 1: ?php: No such file or directory

/home/<username>/public_html/sms/auto.php: line 3: syntax error near unexpected token `"config.php"'
/home/<username>/public_html/sms/auto.php: line 3: `include("config.php");'

EDIT: fixed --> was chmoding everything to 777 - changed it and now runs but gets the "couldn't open stream" argument
 

thumper

New Member
May 24, 2005
1
0
1
Thanks Icarus3000, works great!

Is there any way to default the text area with my cell phone# so when a person responds to the short message it gets sent to my cell phone instead of Rogers la-la land?
 

Wikidd

New Member
Jul 21, 2005
1
0
1
I was unable to get this to work so I manually recreated the URL and submitted it, I got the following:

"Bad configuration, the query string is not from FORM"

Anyone else run into this? Is this due to the verification Rogers has in place now?

Thanks
 

mimiandi

New Member
Sep 8, 2005
1
0
1
RE: Rogers Email-to-Text

HI guys,
Firstly, this is a great idea. I managed to set everything up and able to receive forwarded emails on my mobile however, when i receive messages, i get UNKNOWN sender and am only allow to send MMS instead SMS. Is this my config problem??? I assume I should be able to send SMS instead of MMS ?

Thanks
 

silhouette2k

New Member
Nov 25, 2005
1
0
1
I am also unable to get this to Work. i am getting the follwoing error

"Bad configuration, the query string is not from FORM"

Any ideas will be appreciated

Thanks
 

big_raji

New Member
Dec 3, 2005
4
0
1
THanks to brickhost for the great script.

I added a few modifications, which puts the "from" name and the subject in the body of the message. The SMS message will look like this:

------
From: Unknown
From Name (subject) Message
------

If someone knows the variable for "from" on the rogers script, the script can be easily modified.

Heres the code for the modified cron job index.php script. You can modify it the same way for the other index.php script as well.
Code:
<?
include('config.php');

$MC=imap_check($mbox);
$MN=$MC->Nmsgs;
$overview=imap_fetch_overview($mbox,"1:$MN",0);
$size=sizeof($overview);

$header = imap_headerinfo($mbox, 1, 80, 80);
$from = $header->from;
foreach ($from as $id => $object) {
   $fromname = $object->personal;
   $fromaddress = $object->mailbox . "@" . $object->host;
}
   $subject = $header->fetchsubject;

if($size !="0"){
$message = $fromname;
$message .= " (";
$message .= $subject;
$message .= ") ";
$message .=imap_fetchbody($mbox, 1, 1);

$result = mb_strlen($message);
if($result > 160){
$cut = substr($message, 0, 160);
$message = $cut;

}
imap_delete($mbox, 1);
imap_expunge($mbox);

$URL="http://216.129.53.44:8080/cgi-bin/send_sm_rogers.new";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "msisdn=".$smsnum."&text=".$message."&SIZEBOX=".$result);curl_exec ($ch);
curl_close ($ch);

}

imap_close($mbox);


?>

Hopefully that came out ok.

I don't know a thing about PHP, I basically just cut and paste snippets that I could find on the web. If someone with some PHP knowledge can clean it up, or make it nicer, woohoo! Of particular note, the 5 lines of code to define the "$message" could easily be merged into one line if I knew how. :)
 

big_raji

New Member
Dec 3, 2005
4
0
1
So does anyone know how to put a value in the "From" field?

Code:
"msisdn=".$smsnum."&text=".$message."&SIZEBOX=".$result);curl_exec ($ch);

Obviously, 'msisdn' is the cell phone number, 'text' is the message text, and 'SIZEBOX' is the message length. I've tried variables like "from" and "sender" but neither of them work.

Any ideas out there?