
drkylec
Members-
Posts
13 -
Joined
-
Last visited
Never
Everything posted by drkylec
-
Does anyone know how to get a specific part of a message like the body of a email with fsockopen because I have it working. I want to make it a update page on the fly so when im not at my computer I can still send updates this is my code: <?php $fp=fsockopen("mail.webhost.com", 110, $errno, $errstr, 30); if($fp){ //echo 'Connected!<br>'; $username="USER [email protected]\r\n"; $password="PASS password1\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); ?> I got the code from another forum it works for me but I need to get only the message part to show not the sender and recipient and time. This is my output +OK 1856 octets Return-Path: X-Original-To: [email protected] Delivered-To: [email protected] Received: from localhost (unknown [127.0.0.1]) by mail.webhost.com ([000webhost.com Mail System]) with ESMTP id 6FA6D1C00D6 for ; Wed, 25 Mar 2009 12:45:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at 000webhost.com Received: from mail.webhost.com ([127.0.0.1]) by localhost (nameserver.webhost.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3OHt0bQbUrAK for ; Wed, 25 Mar 2009 08:45:59 -0400 (EDT) Received: from server.hosting24.com (www.webhost.com [208.43.150.234]) by mx.webhost.com ([webhost.com Mail System]) with ESMTP id 429911C00D1 for ; Wed, 25 Mar 2009 08:45:59 -0400 (EDT) Received: from nobody by server.hosting24.com with local (Exim 4.69) (envelope-from ) id 1LmSUU-0004Gy-7n for [email protected]; Wed, 25 Mar 2009 07:45:54 -0500 To: [email protected] Subject: Welcome to webhost.com Email Server From: [email protected] Reply-To: [email protected] X-Mailer: PHP/5.2.6 Message-Id: Date: Wed, 25 Mar 2009 07:45:54 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.hosting24.com X-AntiAbuse: Original Domain - axeheadstudio.com X-AntiAbuse: Originator/Caller UID/GID - [99 99] / [47 12] X-AntiAbuse: Sender Address Domain - server.hosting24.com [color=red]Congratulations! Your new email box has been created, we hope you enjoy our enterprise level email system, and if you will like our services, add a link to www.webhost.com from your website -- Your hard working team of webhost.com[/color] . All i want is what is in red
-
Sending a update message to my website form cellphone?
drkylec replied to drkylec's topic in PHP Coding Help
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 [email protected]\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. -
Sending a update message to my website form cellphone?
drkylec replied to drkylec's topic in PHP Coding Help
Well the good news is i figured out how to connect now i need to figure out how to display the emails so that others can see it. -
Sending a update message to my website form cellphone?
drkylec replied to drkylec's topic in PHP Coding Help
never mind my last post i found out the my webhost does not allow imap_open and i have to figure out how to use fsockopen instead. -
Sending a update message to my website form cellphone?
drkylec replied to drkylec's topic in PHP Coding Help
since i am using a webhost and not my localhost machine would i be putting mx.webhost.com instead of localhost im just trying to figure out if thats why i cant connect or if it is a security block. -
Sending a update message to my website form cellphone?
drkylec replied to drkylec's topic in PHP Coding Help
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", "[email protected]", "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. -
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.
-
A little about my site...My site is of my three friends and I. We started to make movies and we are looking to make our site a great place for others to view our videos. i make changes to the site almost daily, but i feel like that my site needs a lot of work. I am still new to php and hope that this is a a good start. I can take good and bad news on what others think and will try to change it accordingly. You can view my site at http://www.axeheadstudio.com/ also please note that there are some pages that you must be signed up and in for to view. Thanks ahead of time for anyone who will view and review for me.
-
The easiest way to answer your question would be to tell you to google for a tutorial. I took the liberty of trying this already. I didnt find much but this seems to be the best i could find http://eduspaces.net/news/weblog/647.html or if you want to cough up some dough psisns is a good one to look into it is a lot like myspace. Hope this helped.
-
So what you telling me if I understand you right that it isn't my code and your guess is that it has to do with the cell phone or the provider? Sorry if I seem stupid trying to understand sms better.
-
I have the sending of my message form the browser to the cell phone working the only problem I am having is that when i send the message it will not display the e-mail from the user i get [email protected] i will post my code if anyone can help me that would be great thank you. On an added note i have it where you can only access the page if you are logged in to my site so i need to find out why it wont pull the email form my database and put it into the from. <?php include("database.php"); include("constants.php"); $from = $_POST['from']; $to = $_POST['to']; $carrier = $_POST['carrier']; $message = stripslashes($_POST['message']); $Email = $_POST['Email']; // Collect other variables from POST here mail($PhoneNumber, $Subject, $Message, 'From: ' . $Email); if ((empty($from)) || (empty($to)) || (empty($message))) { header ("Location: sms_error.php"); } else if ($carrier == "verizon") { $formatted_number = $to."@vtext.com"; mail("$formatted_number", "Axe Head Studio", "$message"); // Currently, the subject is set to "SMS". Feel free to change this. header ("Location: sms_success.php"); } else if ($carrier == "tmobile") { $formatted_number = $to."@tomomail.net"; mail("$formatted_number", "Axe Head Studio", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "sprint") { $formatted_number = $to."@messaging.sprintpcs.com"; mail("$formatted_number", "Axe Head Studio", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "att") { $formatted_number = $to."@txt.att.net"; mail("$formatted_number", "Axe Head Studio", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "virgin") { $formatted_number = $to."@vmobl.com"; mail("$formatted_number", "Axe Head Studio", "$message"); header ("Location: sms_success.php"); } ?> <?php $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( "[email protected]", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.axeheadstudio.com/sms_success.php" ); ?> -drkylec http://www.axeheadstudio.com/ http://www.youtube.com/axeheadstudio