Jump to content

Sending as Junkmail


DarkPrince2005

Recommended Posts

Is there anyway i can make the email to not be recognised or sent as junkmail

 

<?php

$filename='test.txt';
$arremails=file($filename);

for ($i=0;$i<=$arremails; $i++){
$subject = 'Test HTML email';
//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time()));
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: email@isp.co.za\r\nReply-To: email@isp.co.za";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\"";
//define the body of the message.
ob_start(); //Turn on output buffering
?>
--PHP-alt-<?php echo $random_hash; ?> 
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

[i][b]Plain text email[/b][/i]

--PHP-alt-<?php echo $random_hash; ?> 
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
[i][b]HTML Formatted mail[b][/i]--PHP-alt-<?php echo $random_hash; ?>--
<?

//send the email

//copy current buffer contents into $message variable and delete current output buffer
$message = ob_get_clean();
mail($arremails[$i], $subject, $message, $headers);
};
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.