Question

I am sending email using SMTP in my application. The emails are going through, but they are not showing up in the Sent folder of the sender on the mailserver :(

Here is the code which I use to send the mails:

$emailConfig = array(                           
  "mailtype"  => "html",
  "protocol"  => "smtp",
  "smtp_host"  => "host",
  "smtp_user"  => "user",
  "smtp_pass"  => "password",
  "smtp_port"  => "port"                
);              

$this->load->library('email', $emailConfig);
$this->email->from("from");         
$this->email->to("to");         
$this->email->message("message");    
$this->email->subject("subject");    
@$this->email->send();

I searched a lot for a solution, unfortunately it didn't help me.

Although I got some suggestions: "send email via smtp and store the mail via IMAP in the Sent IMAP folder".

Is this work for me or is there any other way to handle this issue?

Était-ce utile?

La solution

Sending a mail (with SMTP) and storing it in the Sent folder (with IMAP) are two different things, although most mail client does this concurrently. There are very specific SMTP servers (best example is the gmail), who can store a copy of the sent mails in the "Sent" IMAP-Folder of the actual user, but this is an extraordinary feature and most server doesn't do this.

The php mailing library, which you are using, is probably capable to do this as well.

But in your code fragment there is nothing about the IMAP configuration. You should set it also up.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top