I'm using a little script I found on the net to send an e-mail from a submit form, it's been working great, but now my cell provider limits the length of my messages.
I would like to adjust this script to break apart the message for every, say 160 characters, and send the message in separate chunks.
Thanks for any help, it is greatly appreciated.
<?php
// get posted data into local variables
// replace John Doe's with your own name and address
$EmailFrom = Trim($_POST[EmailFrom]);
$EmailTo = "Me <test@test.com>";
$Subject = "Test";
$Message = Trim($_POST[Message]);
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (Trim($Message)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=no.htm\">";
exit;}
// prepare email body text
// tells you that the mail is sent from this form
// $Body .= "Test Form:\n";
$Body = "$Message";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){print "<meta http-equiv=\"refresh\" content=\"0;URL=yes.htm\">";}
else{print "<meta http-equiv=\"refresh\" content=\"0;URL=no.htm\">";}
// send copy of email to visitor
// replace John Doe's with your own name and address
// mail("$Name <$EmailFrom>", "John Doe has received your message '$Subject'",
// "You wrote: $Message", "From: John Doe <johndoe@dot.com>");
?>