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	=	'support@alacritysim.com';  // 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
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

Link to comment
Share on other sites

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 ;)

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.