<?php
//-------------------------------------------------------------------------
// YW Guestbook
// mail_sendmail.php
//
// Version: 1.2
//-------------------------------------------------------------------------
// Copyright (c) 2005 YahooWebs
// http://www.yahoowebs.tk
//-------------------------------------------------------------------------
// This program is free software. You can redistribute it and/or modify
// it under the terms of the License that was distributed with this file!
//-------------------------------------------------------------------------
define ( "RETURNPATH" , "webmaster@".vgb_servername() );
define ( "CMDLINEPARAMETER" , "-f".RETURNPATH ); // set this constant to "" if you get an
// 'X-Warning' in the mail header !
define ( "HEADERSEPERATOR" , "\n" ); // on some server you must use "\r\n" as seperator
define ( "MAILCHARSET" , "iso-8859-1" );
//------------------------------------------------------------------------
function vgb_mail( $to , $s , $m, $h = array()) {
global $settings;
// set header
$h['MIME-Version'] = "1.0";
$h['X-Mailer'] = "ViPER Guestbook Mailer V".$settings['VERSION'];
$h['From'] = ($settings['EMAILFROM'] != "") ? $settings['EMAILFROM'] : "ViPER Guestbook Mailer V".$settings['VERSION'];
if (!isset($h['Content-Type']))
$h['Content-Type'] = "text/plain; charset=".MAILCHARSET;
$h['Content-transfer-encoding'] = "8bit";
$h['X-Priority'] = "3";
$h['X-MSMail-Priority'] = "Normal";
$header = "Return-Path: ".RETURNPATH.HEADERSEPERATOR;
foreach ($h as $f => $v) {
$header .= $f.": ".$v.HEADERSEPERATOR;
}
if ((CMDLINEPARAMETER != "") && !((bool) ini_get('safe_mode')))
return mail($to, $s, $m, $header, CMDLINEPARAMETER);
else
return mail($to, $s, $m, $header);
}
?>