The idea of my project is to retrieve Emails from Gmail using IMAP and store it in database.
Than send new messages using PHPMailer.
My problem is how can i reply to an email that's exist in my database, and what information do i need to reply to an email .
This is the code i'm using to send emails . but i can't reply to an email . when ever i want to reply to an email i find that i just send new one .
This is just the model
public function send_email_reply($from, $to, $subject, $message)
{
$body =
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>'.htmlspecialchars($subject, ENT_QUOTES, $this->email->charset).'</title>
<style type="text/css">
body {
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 16px;
}
</style>
</head>
<body>
'.$message.'
</body>
</html>';
$body = $this->email->full_html($subject, $message);
$result = $this->email
->from($from)
->to($to)
->subject($subject)
->message($body)
->send();
return $result;
}