|
Posted by windandwaves on 11/11/05 09:34
Andy Hassall wrote:
> On Fri, 11 Nov 2005 12:33:30 +1300, "windandwaves"
> <winandwaves@coldmail.com> wrote:
>
>> Is there anyway in avoiding the Spam Assassin tag:
>> MIME_BASE64_TEXT: Message text disguised using base64 encoding
>>
>> when sending email using the mail() function?
>
> Don't disguise your message text using base64 encoding would be the
> obvious answer? Are you saying you're getting false positives despite
> not base64-encoding?
My messages are 64 encoded. If you dont do this (they are html), then you
get nonsense!
Basically, I am wondering if anyone out there has a basic PHP mailing
function that is similar to the one below, but reduces spam levels.
function SendMail($From,$FromName,$To , $ToName,$Subject,$Text,$Html,
$returnaddress){
//die("from ".$From." From Name: ".$FromName." to mail: ".$To." to Name:
".$ToName." subject: ".$Subject." text: ".$Text." html: ".$Html."
returnaddress: ".$returnaddress);
$OB="----=_OuterBoundary_000";
$IB="----=_InnerBoundery_001";
$From or die("sender address missing");
$To or die("recipient address missing");
$headers ="MIME-Version: 1.0\r\n";
$headers.="From: ".$FromName." <".$From.">\n";
$headers.="To: ".$ToName." <".$To.">\n";
$headers.="Reply-To: ".$FromName." <".$From.">\n";
$headers.="Content-Type: multipart/mixed;\n boundary=\"".$OB."\"\n";
//Messages start with text/html alternatives in OB
$Msg ="This is a multi-part message in MIME format.\n";
$Msg.="\n--".$OB."\n";
$Msg.="Content-Type: multipart/alternative;\n boundary=\"".$IB."\"\n\n";
//plaintext section
$Msg.="\n--".$IB."\n";
$Msg.="Content-Type: text/plain;\n charset=\"iso-8859-1\"\n";
$Msg.="Content-Transfer-Encoding: quoted-printable\n\n";
$Msg.=$Text."\n\n";
// html section
$Msg.="\n--".$IB."\n";
$Msg.="Content-Type: text/html;\n charset=\"iso-8859-1\"\n";
$Msg.="Content-Transfer-Encoding: base64\n\n";
$Html =stripslashes($Html);
$Msg.=chunk_split(base64_encode($Html))."\n\n";
// end of IB
$Msg.="\n--".$IB."--\n";
//message ends
$Msg.="\n--".$OB."--\n";
if(!$subject or $subject = "") {
$subject = "message from ".$FromName;
}
if($returnaddress) {
$returnaddress = '-f'.$returnaddress;
}
mail($To,$Subject,$Msg,$headers, $returnaddress);
syslog(LOG_INFO,"Mail: Message sent to $ToName <$To>");
return 1;
}
TIA
- Nicolaas
Navigation:
[Reply to this message]
|