doukui2011 2014-04-29 07:47
浏览 109
已采纳

使用smtp发送邮件并将其反映在电子邮件服务器的“已发送”文件夹中

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?

  • 写回答

1条回答 默认 最新

  • dtg78700 2014-04-29 07:54
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 类鸟群Boids——仿真鸟群避障的相关问题
  • ¥15 CFEDEM自带算例错误,如何解决?
  • ¥15 有没有会使用flac3d软件的家人
  • ¥20 360摄像头无法解绑使用,请教解绑当前账号绑定问题,
  • ¥15 docker实践项目
  • ¥15 数电几道习题,写出作答过程,ai一律不采用
  • ¥15 利用pthon计算薄膜结构的光导纳
  • ¥15 海康hlss视频流怎么播放
  • ¥15 Paddleocr:out of memory error on GPU
  • ¥30 51单片机C语言数码管驱动单片机为AT89C52