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.

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

报告相同问题?

悬赏问题

  • ¥15 vc6.0中想运行代码的时候总是提示无法打开文件是怎么回事
  • ¥25 关于##爬虫##的问题,如何解决?:
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题