Jump to content

Sending a update message to my website form cellphone?


drkylec

Recommended Posts

I was wondering if there is a way that I could make a small program, that will allow me and other allowed members, to send messages to the homepage, or a message update page for my website? I don't think there is a way without paying for some cellphone sms site program. It's not really important just good if i could update on the fly.

Link to comment
Share on other sites

You could send an email via your phone and then catch the emails in your website and display the content, kind of like you do with private messages on forums.

Or I dont know if there is some free service that catches text messages and then pull them from there, but im sure its possible.

Link to comment
Share on other sites

ah i didnt really know that.

But you can connect to a pop3 or imap account and optain the information from the email address.

Look up the function imap_open();

also imap_headers('imap connection in here') to optain the list of messages.

Run a loop to display all messages and a link to each message, or you might be able to just display the contents of each message.

But its possible with email, take a little time to do i would think. Probably have a few headaches along the way.

 

As it happens brian you seem to know more about forums than me, I have a problem with trying to get anchors to work in html. I have posted a question in the html section but no response yet I dont suppose you could take a look?

Link to comment
Share on other sites

It depends on what you're actually trying to do, if you want a 'status' type system (e.g. Facebook, Twitter) then you could simply make a separate page which is mobile friendly which allows you to update that message.

 

Or yes, you could write an email catching service but this would require a scheduled task to be run every X minutes to check for updates.

 

If you could provide more details on what you actually intend to do that would be helpful.

Link to comment
Share on other sites

I guess, but it depends how fast it can grab the emails, you could see the page taking a while to load and so it would be much safer to just run a scheduled task.

 

Although, you're right, you would be able to run the code whenever someone hits the page.

Link to comment
Share on other sites

i would imagine it would be the same speed as when you check your email online. Iv never tried it.

Iv never done a scheduled task myself so this might be wrong, but is my thinking correct when you do a scheduled task it is primarily to update a database at a set period? Or does it have nothing to do with a database?

If that is the case then you have an advantage over doing a scheduled task in that you dont use your own database space instead you are using the email providers space.

Link to comment
Share on other sites

I looked up the imap_open and this si what i get for code

 

<?php
// To connect to an IMAP server running on port 143 on the local machine,
// do the following:
$mbox = imap_open("{webserver:143}INBOX", "whatever@whatever.com", "mypassword");
?>

 

when i tried to edit it i would get an error telling me that imap is undefined it is probably a common easy fix but if someone could help me that would be great and thank you for the help so far.

Link to comment
Share on other sites

try this one:

 

$mbox = imap_open ("{localhost:110/pop3}INBOX", "user_id", "password");

 

it may be undefined because your computer blocking access to the port.

 

Also I believe it is going to take a little more work to get the information etc  this is just a connection at the end of the day and will return either true or false.

Link to comment
Share on other sites

im on the final stretch for the getting it to at least show on a page part all i need is to figure out what part of this code i have that i need to comment out or delete in order to display only the subject of the message in the page.

 

<?php
$fp=fsockopen("mail.webhost.com", 110, $errno, $errstr, 30);
if($fp){
   //echo 'Connected!<br>';
   
   $username="USER user@user.com\r\n";
   $password="PASS password\r\n";

   $us=fwrite($fp, $username, strlen($username));
   $ur=fgets($fp);
   //echo 'Username sent, server response: '.$ur.'<br>';
   $ps=fwrite($fp, $password, strlen($password));
   $pr=fgets($fp);
   //echo 'Password sent, server response: '.$pr.'<br>';
   
   $res=fgets($fp);
   $parts=explode(" ", $res);
   //echo $parts[4].' messages on server<br><br>';
   
   $cmd="LIST\r\n";
   $get=fwrite($fp, $cmd, strlen($cmd));
   $msg=fread($fp, 8192);
   //echo '<pre>'.$msg.'</pre>';
   
   $cmd="RETR 1\r\n";
   $get=fwrite($fp, $cmd, strlen($cmd));
   $msg=fread($fp, 8192);  
   echo '<pre>'.$msg.'</pre>';
}
else{
   echo 'Failed Connecting!<br>';
}
fclose($fp);
?>

 

if someone could figure it out for me that would be nice while I play around with it to figure it out.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.