0

I'm using the following script to send out mails with php

$status = $_POST['status'];
$subject = $_POST['subject'];
$from = "info@example.com";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers  .= "From: $from\r\n";
$recipment = $_POST['to'];


if (mail($emailTo, $subject, $body, $headers)){

    return 'Email sent!';

}

I would like save a copy of all outgoing mails to the used accounts outbox. Which php mailer functions are available to achieve this.

fefe
  • 8,755
  • 27
  • 104
  • 180
  • 1
    `$headers .= 'Bcc: your_email@your_domain.com' . "\r\n";` will send you a copy too – Pedro del Sol Feb 21 '13 at 09:34
  • Probable duplicates: http://stackoverflow.com/questions/10975488/putting-e-mail-into-sent-folder-after-php-mail-function http://stackoverflow.com/questions/8561495/sent-mails-with-phpmailer-dont-go-to-sent-imap-folder/8561849 – Wouter Feb 21 '13 at 09:35
  • I suspect it will depend on the available protocols. SMTP, IMAP, Exchange, ... – Wouter Feb 21 '13 at 09:36
  • the first suggestion is fast and dirty workaround but I would like to separate the mail correspondence so I suppose I should build on imap a function which can take care of it – fefe Feb 21 '13 at 09:50
  • I have been trying to use phpmailer but till now no luck. The email is getting send it but I don't see my mail in outbox – fefe Feb 21 '13 at 14:01

0 Answers0