简体   繁体   English

在PHP邮件功能之后将电子邮件放入“已发送”文件夹

[英]Putting E-mail into “sent” folder after PHP mail function

I am currently working on a project where I am accessing an e-mail account using PHP's imap_open(). 目前,我正在使用PHP的imap_open()访问电子邮件帐户的项目。 I know that I can send an e-mail with PHP using the mail() function. 我知道我可以使用mail()函数通过PHP发送电子邮件。

However, I was wondering if, after I send an e-mail, I could place that e-mail in the email account's sent folder using any of PHP's imap functions. 但是,我想知道在发送电子邮件之后,是否可以使用PHP的imap函数中的任何一个将该电子邮件放置在电子邮件帐户的已发送文件夹中。

Any help would be greatly appreciated. 任何帮助将不胜感激。

This is more to email account setting to save the email sent to sent account folder. 这更多用于电子邮件帐户设置,以保存发送到已发送帐户文件夹的电子邮件。

You may try with external mail that already configured to save email sent to sent folder eg Gmail http://www.vulgarisoip.com/files/phpgmailer.zip 您可以尝试使用已配置为保存发送到已发送文件夹的电子邮件的外部邮件,例如Gmail http://www.vulgarisoip.com/files/phpgmailer.zip

example : 例如:

require_once('/phpgmailer/class.phpgmailer.php');
$mail = new PHPGMailer();
$mail->Username = 'user@domain.com'; 
$mail->Password = 'password';
$mail->From = 'user@domain.com'; 
$mail->FromName = 'User Name';
$mail->Subject = 'Subject';
$mail->AddAddress('myfriend@domain.com');
$mail->Body = 'Hey buddy, here\'s an email!';
$mail->Send();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM