Results for mail : 3

1 - sendmail
function sendmail($to,$subject='message',$msg,$from=null,$format='text/plain'){
	$r="\r\n";$header='';
	$msg=wordwrap($msg, 70,$r);
	if ($format!='text/plain'){$msg=htmlspecialchars($msg);}
	if (!empty($from)){$header.='From: '.$from.$r;}
	$header='Content-Type: text/plain; charset="utf-8"'.$r.'Content-Transfer-Encoding: 8bit'.$r.$header;
	return mail($to,$subject,$msg,$header);
}
			
2 - Aidan Lister » Blog Archive » Quick JavaScript email obfuscation
/**
 * Obfuscate an email address
 *
 * @author      Aidan Lister <aidan@php.net>
 * @version     1.1.0
 * @link        http://aidanlister.com/2004/04/quick-javascript-email-obfuscation/
 * @param       string      $email      E-mail
 * @param       string      $text       Text
 */
function mail_obfuscate($email, $text = '')
{
    // Default text
    if (empty($text)) {
        $text = $email;
    }
     
    // Create string
    $string = sprintf('document.write('<a href="mailto:%s">%s</a>');',
            htmlspecialchars($email),
            htmlspecialchars($text));
 
    // Encode   
    for ($encode = '', $i = 0; $i < strlen($string); $i++) {
        $encode .= '%' . bin2hex($string[$i]);
    }
 
    // Javascript
    $javascript = '<script language="javascript">eval(unescape('' . $encode . ''))</script>';
 
    return $javascript;
}
			
3 - Encoder une adresse email
function encode_email($email='info@domain.com', $linkText='Contact Us', $attrs ='class="emailencoder"' )  
{  
    // remplazar aroba y puntos  
    $email = str_replace('@', '@', $email);  
    $email = str_replace('.', '.', $email);  
    $email = str_split($email, 5);  
  
    $linkText = str_replace('@', '@', $linkText);  
    $linkText = str_replace('.', '.', $linkText);  
    $linkText = str_split($linkText, 5);  
      
    $part1 = '<a href="ma';  
    $part2 = 'ilto:';  
    $part3 = '" '. $attrs .' >';  
    $part4 = '</a>';  
  
    $encoded = '<script type="text/javascript">';  
    $encoded .= "document.write('$part1');";  
    $encoded .= "document.write('$part2');";  
    foreach($email as $e)  
    {  
            $encoded .= "document.write('$e');";  
    }  
    $encoded .= "document.write('$part3');";  
    foreach($linkText as $l)  
    {  
            $encoded .= "document.write('$l');";  
    }  
    $encoded .= "document.write('$part4');";  
    $encoded .= '</script>';  
  
    return $encoded;  
}