I am trying to dynamically send text messages using a PHP script. PHP code:
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=utf-8' . "
";
$textbody=<<<_MESSAGE_
Some text
_MESSAGE_;
mail('myphonenumber@SMSgateway','subject',$textbody,$headers);
I did receive a text message, but it is a "photo message" or rather multimedia instead of text and I am unable to open the message. I have tried playing around with the encoding and $textbody="this text"; instead of *MESSAGE*.
a) How can I send a normal text message (not multimedia)?
b) Why can't I open it?
c) Is there a way for people to respond to the texts I send with text? When I sent myself a text from hotmail I was able to reply and I got the answer in my inbox. When I tried to put $header.= 'From: me <me@somedomain.com>' . " ";
the email wouldn't send
(reason: 553 sorry, your mail was administratively denied. (#5.7.1))
Thanks!
$sendTo = "test@test.com";
$subject = trim($_POST['subj']);
$headers = "From: ".$_POST['name']."<" . trim($_POST["email"]) .">
";
$headers .= "Reply-To: " . trim($_POST["email"]) . "
";
$headers .= "Return-path: " . trim($_POST["email"]);
$headers .= "
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset=utf-8
";
$message = strip_tags($_POST["messg"]);
if (@mail($sendTo, $subject, $message, $headers))
{ echo "sent successfully"; }
else
{ echo "Error ... Plz try again later" ; }
This code which I'm using to send emails I worked before on SMS project so if you have any question about how to link with Getaway feel free to contact me