Jump to content

Send a text message with HTML?


kernelgpf

Recommended Posts

I have been Googling for hours and cannot find a solution. My code:

 

$from_name	=	'Alacrity';
$from_email	=	'[email protected]';  // From Phone Number
$sendto = $urow[phone].$urow[phone_email];
$headers .= "From: ".$from_email."\r\n";
$headers .= "Reply-To: ".$from_name." <".$from_email.">\r\n";
//$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$subj = "Alacrity Alert"; 
$body = "<a href='userprofiles.php?id=$sid'>Player #$sid</a> scribbled on <a href='userprofiles.php'>your profile</a>!";		

mail($sendto, $subj, $body, $headers);

 

I've tried mlutiple charsets I've found online, and all I know is when I add the MIME line it simply erases all HTML. I'm trying to have this sent as a text message that contains clickable links to the pages specified in the HTML. Help?

Link to comment
https://forums.phpfreaks.com/topic/196716-send-a-text-message-with-html/
Share on other sites

You cant. That why it s TEXT message. Some phones will accept a pushed WAP(wml) message sent through a GSM modem or a GSM phone connected to a PC.

http://www.developershome.com/sms/howToSendSMSFromPC.asp

http://www.developershome.com/sms/howToSendSMSFromPC.asp

 

 

HTH

Teamatomic

You actually can send a text message using email. Something like:

 

<?php
$number = '5255558794';

$num_suffix = 'txt.att.net';

mail($number . '@' . $num_suffix, 'Some Subject...', 'This is a SMS sent via the PHP mail() function.', 'From: Mr. Text <15735558372>');

 

All major carriers have some way of sending a text to a phone via an email address. Some simple googling will get you a list of them, and then you can obviously use a dropdown or something to have the user specify their carrier when they enter their number, or even do a lookup of the number.

 

Oh, and that stuff isn't HTML, it's PHP ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.