Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Unable to send mail Reply To: Unable to send mail

#146679
iamRDM
Participant

error_reporting(0);
@include “db.php”;
@include “geekmail.php”;
$res=mysql_query(“select * from config”)or die(mysql_error());
while($row=mysql_fetch_array($res)){
$cfg[$row[‘name’]]=$row[‘value’];
}
session_start();

function mailer($to,$subject,$message,$attach=”){
global $cfg;
$geekMail = new geekMail();
$geekMail->setMailType(‘html’);
$geekMail->from($cfg[’email’], $cfg[‘name’]);
$geekMail->to(array($to));
$geekMail->subject($subject);
$geekMail->message(nl2br($message));
if($attach){
$geekMail->attach($attach);
}
if (!$geekMail->send())
{
return 0;
}else{
return 1;
}
}