| Server IP : 192.169.170.185 / Your IP : 216.73.216.97 Web Server : Apache System : Linux p3plmcpnl495852.prod.phx3.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64 User : akhilnew ( 1712764) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/akhilnew/public_html/libraries/ |
Upload File : |
<?php
class sendmail extends functions {
public function __construct()
{
parent::__construct();
}
// public function send($to, $cc, $bcc, $subject, $message, $fromname, $fromemail, $replyname, $replyemail, array $attachments = NULL)
// {
// require_once(LIB.'mailer/ses.php');
// $ses = new SimpleEmailService('AKIAIDIR4P6FKE3NK7AA', 'NZFkFKR5DsqEFeQpB+p18r9vwe3oJ06yEFIu5Ll2');
// $m = new SimpleEmailServiceMessage();
// foreach(explode(',', $to) as $email)
// {
// $m->addTo(trim($email));
// }
// if($cc)
// {
// foreach(explode(',', $cc) as $email)
// {
// $m->addCC(trim($email));
// }
// }
// if($bcc)
// {
// foreach(explode(',', $bcc) as $email)
// {
// $m->addBCC(trim($email));
// }
// }
// if($replyname && $replyemail)
// {
// $m->addReplyTo($replyname.' <'.$replyemail.'>');
// }
// $m->setFrom($fromname.' <'.$fromemail.'>');
// $m->setSubject($subject);
// $m->setMessageFromString('', $message);
// if(is_array($attachments) && sizeof($attachments) > 0)
// {
// foreach($attachments as $attachment)
// {
// $m->addAttachmentFromFile(basename($attachment), $attachment);
// }
// }
// $ses->sendEmail($m);
// return TRUE;
// }
public function send($to, $cc, $bcc, $subject, $message, $fromname, $fromemail, $replyname, $replyemail, $attachments = null)
{
require_once LIB.'Sendgrid.php';
$sendgrid = new Sendgrid();
$sendgrid->from = $fromname;
$sendgrid->fromEmail = $fromemail;
$sendgrid->reply = $replyname;
$sendgrid->replyEmail = $replyemail;
$sendgrid->send($to, $subject, $message, $attachments);
// require_once LIB.'mailer/class.phpmailer.php';
// $mail = new PHPMailer();
// $mail->IsSMTP(true);
// $mail->SMTPAuth = false;
// $mail->Mailer = 'smtp';
// $mail->Host = 'localhost';
// $mail->Port = 25;
// $mail->Username = '';
// $mail->Password = '';
// $mail->SetFrom($fromemail, $fromname);
// $mail->AddReplyTo($replyemail, $replyname);
// $mail->Subject = $subject;
// $mail->MsgHTML($message);
// $addresses = $to;
// $addresses = explode(',', $addresses);
// foreach($addresses as $address)
// {
// $mail->AddAddress(trim($address), $to);
// }
// if($cc)
// {
// foreach(explode(',', $cc) as $email)
// {
// $mail->AddCC(trim($email));
// }
// }
// if($bcc)
// {
// foreach(explode(',', $bcc) as $email)
// {
// $mail->AddBCC(trim($email));
// }
// }
// if((is_array($attachments)))
// {
// foreach($attachments as $attachment)
// {
// $mail->AddAttachment($attachment);
// }
// }
// $mail->Send();
return true;
}
}
$sm = new sendmail();
?>