<?php
function Send_Mail($to,$subject,$body)
 {
include('config/loadconfig.php');
//include($_SERVER["DOCUMENT_ROOT"].'/anunturi/config/loadconfig.php');
require_once 'class.phpmailer.php';

if(!empty($rwset['domeniu'])){
$from = 'nu-raspunde@'.$rwset['domeniu'];
 }else{
    $from = 'nu-raspunde@'.$_SERVER["HTTP_HOST"];
 }

//$from = $rwset['mailuser'];
$mail = new PHPMailer();
$mail->IsSMTP(true);
$mail->SMTPAuth   = true;
$mail->Mailer = "smtp";
$mail->Host       = "ssl://".$rwset['mailhost'];
$mail->Port       = $rwset['mailport'];
$mail->Username   = $rwset['mailuser'];
$mail->Password   = $rwset['mailpass'];
$mail->SetFrom($from, $rwset['mailfrom']);
$mail->AddReplyTo($from, $rwset['mailuser']);
$mail->Subject = $subject;
$mail->MsgHTML($body);
$address = $to;
$mail->AddAddress($address, $to);

if(!$mail->Send())
return false;
else
return true;
 }
 
/* function Send_Maila($toa,$subjecta,$bodya)
 {
include('config/loadconfig.php');
//include($_SERVER["DOCUMENT_ROOT"].'/anunturi/config/loadconfig.php');
require_once 'class.phpmailer.php';
if(!empty($rwset['domeniu'])){
    $from = 'nu-raspunde@'.$rwset['domeniu'];
 }else{
    $from = 'nu-raspunde@'.$_SERVER["HTTP_HOST"];
 }
$mail = new PHPMailer();
$mail->IsSMTP(true);
$mail->SMTPAuth   = true;
$mail->Mailer = "smtp";
$mail->Host       = "ssl://".$rwset['mailhost'];
$mail->Port       = $rwset['mailport'];
$mail->Username   = $rwset['mailuser'];
$mail->Password   = $rwset['mailpass'];
$mail->SetFrom($from, $rwset['mailfrom']);
$mail->AddReplyTo($from, $rwset['mailuser']);
$mail->Subject = $subjecta;
$mail->MsgHTML($bodya);
$address = $toa;
$mail->AddAddress($address, $toa);

if(!$mail->Send())
return false;
else
return true;
 }*/
?>