1 (edited by 2010-11-30 16:18:52)

Topic: cute_mail

open functions.inc.php (inc folder)
find (bottom line):


add above:

// Function:      cute_mail Version: 1.0
// Description: Send mail with cutenews
function cute_mail($to,$subject,$message){
// PHP Mail Headers
// http://us2.php.net/manual/en/function.mail.php
if (!isset($config_mail_admin_address) || $config_mail_admin_address == "") {
    $mail_from = "webmaster@".str_replace("www.","",$_SERVER['SERVER_NAME']);
} else {
    $mail_from = $config_mail_admin_address;
} $mail_headers = "";
$mail_headers .= "From: $mail_from\n";
$mail_headers .= "Reply-to: $mail_from\n";
$mail_headers .= "Return-Path: $mail_from\n";
$mail_headers .= "Message-ID: <" . md5(uniqid(time())) . "@" . $_SERVER['SERVER_NAME'] . ">\n";
$mail_headers .= "MIME-Version: 1.0\n";
$mail_headers .= "Content-type: text/plain; charset=US-ASCII\n";
$mail_headers .= "Content-transfer-encoding: 7bit\n";
$mail_headers .= "Date: " . date('r', time()) . "\n";
$mail_headers .= "X-Priority: 3\n";
$mail_headers .= "X-MSMail-Priority: Normal\n";
$mail_headers .= "X-Mailer: PHP\n";
$mail_headers .= "X-MimeOLE: Produced By CuteNews\n";
mail($to,$subject,$message,$mail_headers) or die("Can not send mail.");

open options.mdu (inc folder)

   <input type=hidden name=mod value=options>
   <input type=hidden name=action value=dosavesyscon>".

add above:

      showRow("Admin Email", "used as sender of mail, if blank mail will be from webmaster@yourdomain", "<input type=text style=\"text-align: center;\" name='save_con[mail_admin_address]' value='$config_mail_admin_address' size=40>");

After Uploading: go to the system config page (under options in the script) and set the admin email address (or leave it blank) just make sure you click save (blank or not) so it creates the variable in the config

this will be used for register.php, lostpass.php, and the "author recieves email when someone comments on their post" hack

in general it's freaking useful, in the future it might include smtp support (if anyone wants to help me out with that)

Re: cute_mail

this hack is just a function used by other hacks i have made - look for them