note 9366 modified in mail by jmcastagnetto

From: Date: Tue, 31 Oct 2000 13:01:21 +0000
Subject: note 9366 modified in mail by jmcastagnetto
Groups: php.notes 
Request: Send a blank email to php-notes+get-7195@lists.php.net to get a copy of this message
[Editor's note: You could also use the function wordwrap(), to simplify this task, e.g.: $message = wordwrap($message, 75); ] You may want to wrap the message you send to 75 characters per line, so pine users wont bitch at you. Here is the function: function mailwrap($message) { $line=explode("\n", $message); $message=""; for ($i=0;$i<count($line);$i++) { $line_part=explode(" ", trim($line[$i])); $buf=""; for ($e=0;$e<count($line_part);$e++) { $buf_o=$buf; if ($e==0) $buf.=$line_part[$e]; else $buf.=" ".$line_part[$e]; if (strlen($buf)>75 and $buf_o!="") { $message.=$buf_o."\n"; $buf=$line_part[$e]; } } $message.=$buf."\n"; } return ($message); } http://www.php.net/manual/function.mail.php

« previous php.notes (#7195) next »