use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require HLPR_DIR.'/PHPMailer/Exception.php';
require HLPR_DIR.'/PHPMailer/PHPMailer.php';
require HLPR_DIR.'/PHPMailer/SMTP.php';
function sendmail($toaddress,$toname,$subject,$body,$settings)
{
// test mails send to
//$toaddress1="mackaengin@gmail.com"; $toname1="Engin Dalga";
//$toaddress2="mzeybekoglu0713@gmail.com "; $toname2="Mustafa Zeybekoğlu";
$body_head="";
$body_footer="";
$body_all=$body_head.$body.$body_footer;
$mail = new PHPMailer(true);
try {
$mail->SetLanguage("tr");
$mail->CharSet = 'UTF-8';
//$mail->SMTPDebug = 3;
$mail->SMTPOptions = array (
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true));
$mail->isSMTP();
$mail->Host ="mail.ankaracozum.com";
$mail->SMTPAuth = true;
$mail->Username = "info@ankaracozum.com";
$mail->Password = "ANkara06";
//$mail->SMTPSecure = $settings["smtpsecure"];
$mail->Port = "587";
//Recipients
$mail->setFrom("info@ankaracozum.com","Ankara Çözüm Nakliyat");
$mail->addAddress($toaddress, $toname);
//$mail->addAddress($toaddress1, $toname1);
//$mail->addAddress($toaddress2, $toname2);
//$mail->addReplyTo('info@example.com', 'Information');
//Content
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $body;
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
return 'Mesajınız başarıyla gönderildi.';
} catch (Exception $e) {
return 'Mesaj gönderilirken hata oluştu. Hata Mesajı: '. $mail->ErrorInfo;
}
}
?>
Notice: Undefined variable: message_success in /home/ankaracozum.com/public_html/app/views/teklif_al.php on line 3