OverLord Shell
<?php
$to = 'support@ultraliant.com';
//sender
$from = 'info@trading.com';
$fromName = 'Trading';
//email subject
$subject = 'Contract with Attachment';
//attachment file path
$str="ult.pdf,ult1.pdf";
$files=explode(",",$str);
//$files="ult1.pdf";
//email body content
$htmlContent = '<h1>MUltifile test by chandrakanmt</h1>
<p>This email has sent from PHP script with attachment.</p>';
//header for sender info
$headers = "From: $fromName"." <".$from.">";
//boundary
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
//headers for attachment
$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
//multipart boundary
$message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
if(count($files) > 0){
for($i=0;$i<count($files);$i++){
if(is_file($files[$i])){
$message .= "--{$mime_boundary}\n";
$fp = @fopen($files[$i],"rb");
$data = @fread($fp,filesize($files[$i]));
@fclose($fp);
$data = chunk_split(base64_encode($data));
$message .= "Content-Type: application/octet-stream; name=\"".basename($files[$i])."\"\n" .
"Content-Description: ".basename($files[$i])."\n" .
"Content-Disposition: attachment;\n" . " filename=\"".basename($files[$i])."\"; size=".filesize($files[$i]).";\n" .
"Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
}
}
}
$message .= "--{$mime_boundary}--";
$returnpath = "-f" . $from;
//send email
//echo $to."--".$subject."--".$message."--".$headers."--".$returnpath;
$mail = @mail($to, $subject, $message, $headers, $returnpath);
if($mail){
echo 222;
}else{
echo "fail";}
?>
xRyukZ - Copyright 2k19