brduran Posted April 14, 2008 Share Posted April 14, 2008 If you know PHP, please have a look at the code below ... is regarding attachments, because it works without attachments. I'm getting this error => Warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent ..on line 651 which is the one before the end, it reads => mail($Recipient, $Subject, $Content, $Headers); Since it doesn't look on our part we disabled it, bot we'll keep it on for a day or wo so you can see the error message yourself. There's got to be a way around, I just don't know how. http://www.teknician.com/forms/employment/main.php Any help appreciated. Thank you. #========================================================== # Put Header Information in Email #========================================================== $Headers .= "From: $SendFrom\n"; $Headers .= "Reply-to: $SendFrom\n"; $Headers .= "Return-Path: $SendFrom\n"; if ($CC) $Headers .= "cc: $CC\n"; $Headers .= "X-Mailer: My PHP Mailer\n"; $Headers .= "MIME-Version: 1.0\n"; if ($AttachmentFields and ($ATTACH[0][0] or $ATTACH[1][0] or $ATTACH[2][0])) $Headers .= "Content-Type: multipart/mixed; charset=\"iso-8859-1\";\n\n"; if ($TextEmails == "1") { $Content .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $Content .= "Content-Transfer-Encoding: 8bit\n\n"; $Content .= $EMAIL['textemail']."\n\n"; } if ($HtmlEmails == "1") { $Headers .= "Content-Type: text/html; charset=\"iso-8859-1\";\n\n"; $Content .= $EMAIL['htmlemail']."\n\n"; } if ($AttachmentFields) { for ($x=0;$x<count($ATTACH);$x++) { $TmpFile = "data/".$ATTACH[$x][0]; @copy($ATTACH[$x][1],"$TmpFile"); $fa = @fopen ($TmpFile,'r'); $FileContent = @fread($fa,filesize($TmpFile)); @fclose($fa); $FileContent = chunk_split(base64_encode($FileContent)); $Content .= "Content-Type: application/octetstream;\n name=\"".$ATTACH[$x][0]."\"\n"; $Content .= "Content-Transfer-Encoding: base64\n"; $Content .= "Content-Disposition: attachment;\n filename=\"".$ATTACH[$x][0]."\"\n\n"; $Content .= $FileContent."\n"; @unlink($TmpFile); } } #========================================================== # Send It Off #========================================================== mail($Recipient, $Subject, $Content, $Headers); } // END OF ACTION Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.