Developer technologies | .NET | Other
Microsoft Technologies based on the .NET software framework
4,107 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
public function process($value='')
{
require (APPPATH."libraries/vendor/autoload.php");
$mail = new PHPMailer(true);
try {
$mail->SMTPDebug = 0;
$mail->isSMTP();
$mail->Host = 'smtp.example.com';
$mail->SMTPAuth = true;
$mail->Username = '******@example.in';
$mail->Password = 'example@123';
$mail->SMTPSecure = 'STARTTLS';
$mail->Port = 587;
$from ='******@ck.in';
$to='******@ck.in';
$cc='******@gmail.com';
$mail->setFrom($from, 'CT Account Dept');
$mail->addAddress($to);
$mail->addCC($cc);
$mail->isHTML(true);
$mail->Subject = "testing email";
$mail->Body = "Thanks for contacting regarding xyz.";
if($mail->send())
{
$msg = array('status' =>200 , 'msg'=>'Send Invoice successfully.');
}
else
{
$msg = array('status' =>307 , 'msg'=>'Send Invoice failed.');
}
put_msg($msg);
}
catch (Exception $e)
{
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
}
above code is Using php codigniter, mail cannot be send. please help me to solve this problem.