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

使用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?

图片转代码服务由CSDN问答提供 功能建议

我在我的应用程序中使用SMTP发送电子邮件。 电子邮件正在通过,但它们没有显示在邮件服务器上发件人的已发送文件夹中:(

这是我用来使用的代码 发送邮件:

  $ emailConfig = array(
“mailtype”=>“html”,
“protocol”=>“smtp”,
“  smtp_host“=>”host“,
”smtp_user“=>”用户“,
”smtp_pass“=>”密码“,
”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-&gt  ; email-> send(); 
   
 
 

我搜索了很多解决方案,遗憾的是它没有帮助我。

虽然我收到了一些建议:“通过smtp发送电子邮件并通过IMAP将邮件存储在Sent IMAP文件夹中”

这对我有用吗 或者还有其他任何方式 这个问题?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

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.

    点赞 评论

相关推荐 更多相似问题