SMS via email?

MadJuggla9

2[H]4U
Joined
Oct 9, 2002
Messages
3,515
I know we have all seen websites where you can send your cell phone a message via the web. Some places used to give that ability if you sign up with them.

I have tried sending an email from my phone to my email to find out where it comes from and then replying with no luck (I assume they check that it's not from another phone, or the headers are wrong or something)

The reason I need to do this is so that I can monitor some internet equipment; In the event that it goes down, a script will dispatch a message via cell phone so we can look into it ASAP.

I have a script to attempt socket connections to open ports of the boxes, and tell whether they are responding or not. I just need it to send a text message to a couple of verizon cell phones if any equipment is down. I would send an email, but we need immediate response.

Any help? If this is a touchy subject, I will consult with verizon.
 
I feel your pain with text pages. We have nightly processes that likes to wake me up via text message to a verizon company phone at 2:30a. It's awesome trying to debug code when you're half asleep.

Anyway the format is
[10-digit phone number]@vtext.com
Example: [email protected]
 
I feel your pain with text pages. We have nightly processes that likes to wake me up via text message to a verizon company phone at 2:30a. It's awesome trying to debug code when you're half asleep.

Anyway the format is
[10-digit phone number]@vtext.com
Example: [email protected]

Thats the email I received from the cell phone email, I even tried spoofing as [email protected]
 
any ideas? i've tried as my own number for the sender and the recipient:

Code:
function email_them() {
	$to		= "[email protected]";
	$from	= "[email protected]";
	$subject	= "test";
	$headers		= "From: $from\r\n" . 
				"Reply-To: $from\r\n" . 
				"MIME-Version: 1.0\r\n" . 
				"Content-Type: text/html; charset='iso-8859-1'\r\n" . 
				"Content-Transfer-Encoding: quoted-printable\r\n" . 
				"X-Priority: 3\r\n" . 
				"X-MSMail-Priority: Normal\r\n" . 
				"X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165\r\n";
	$message	= "msg of text";

	mail($to, $subject, $message, $headers);
}
 
Why would you want the mime type as text/html? You'll probably want to specify a plain text format just to be safe.

202276


EDIT: Try text/plain and see if it works.

FURTHER EDIT: Did you register at www.vtext.com ? If so you might have blocked incoming E-Mail text messages (it's possible if registered, not sure how it works otherwise.)
 
nvm it works. mime type doesnt affect it. the server was thinking it was spam/spoof and I had a 1 in front of the number. no registration at vtext needed, it works to all techs

Thanks!
 
Nifty, congrats!

Can't hurt to have the proper mime type in there, however. :)

202276
 
here's the code, it was initially trying to read from multiple ports, but with the email feature it was dumbed down, the root of the program is obvious however:
Code:
<?php
$ping_num	= 5;
$timeout	= 1;
$towers	= array(
			"1.2.3.1",
			"1.2.3.2",
			"1.2.3.3",
			"1.2.3.4",
			);
$ports 	= array(
			"Telnet"	=> 23,
			);


foreach($towers as $ip) {
	$bad_pings	= 0;
	echo "<b>Stats for $ip</b><br>";
	
	for($i=0; $i<$ping_num; $i++) {
		foreach($ports as $key => $port) {
			$handle		= @fsockopen($ip, $port, $errno, $errstr, $timeout);
			if(!$handle) {
				echo "<font face=arial size=2 color=red><b>$key:</b> not running on port <b>$port</b></font><br>";
				$bad_pings+=1;
			} else {
				echo "<font face=arial size=2 color=green><b>$key</b> is running on port <b>$port</b></font><br>";
			}

			ob_flush();
			flush();
		}
	}
	
	echo " - bad pings: $bad_pings<br>";
	if($bad_pings==$ping_num) {
		echo " - <b>NOTIFY</b><br>";
		email_them($ip);
	}
	echo "<br>";
}









function email_them($ip) {
	$ip		= $ip;
	$from	= "[email protected]";
	$subject	= "Equipment socket port fail";
	$headers		= "From: $from\r\n" . 
				"Reply-To: $from\r\n" . 
				"MIME-Version: 1.0\r\n" . 
				"Content-Type: text/html; charset='iso-8859-1'\r\n" . 
				"Content-Transfer-Encoding: quoted-printable\r\n" . 
				"X-Priority: 3\r\n" . 
				"X-MSMail-Priority: Normal\r\n" . 
				"X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165\r\n";
	$message	= "Equipment seems to be down on $ip";
	$phone_num	= array(
					"Person1"	=> "[email protected]",
					"Person2"	=> "[email protected]",
					"Person3"	=> "[email protected]",
					);

	foreach($phone_num as $key => $to) {
		mail($to, $subject, $message, $headers);
		echo "$key: $to<br>";
	}
}
?>
 
Back
Top