Create a gist now

Instantly share code, notes, and snippets.

Embed
<?
$to = 'test@test.com';
$subject = 'The test for php mail function';
$message = 'Hello';
$headers = 'From: test@test.com' . "\r\n" .
'Reply-To: test@test.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$success = mail($to, $subject, $message, $headers);
if ( isset( $success ) )
echo 'E-mail sent to: ' . $to . '<br /> Successful mail?: <strong ' . ( $success ? 'style="color:green;">YES' : 'style="color:red;">NO' ) . '</strong>';
?>
function texto($text, $limit=8) {
if (str_word_count($text, 0) > $limit) {
$words = str_word_count($text, 2);
$pos = array_keys($words);
$text = substr($text, 0, $pos[$limit]) . '...';
}
return $text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment