Jump to content

[SOLVED] after sending mail, mail goes into sentbox, but is stored there as unread


surion

Recommended Posts

like the subject says, after sending a mail, the mail goes into the sentbox perfectly

 

this is what i do:

if(!$mail->Send())
{
echo  _YOUR_EMAIL_WAS_NOT_SENT . "<br>" . $mail->ErrorInfo;
include('newmessage.php');
}
else
{
echo  _YOUR_EMAIL_WAS_SENT_SUCCESSFULLY . "<br><br>";
$header = $mail->CreateHeader();
$body = $mail->CreateBody();
             //this CreateHeader & CreateBody are phpMailer functions

include('mailconnect.php');
imap_append($stream,"{name_OF_MY_MAILSERVER.net}INBOX.Sent", "$header\r\n" . "$body\r\n");//
imap_close($stream);

include('inbox.php');
}

 

as you can see, after phpMailer did his job (sending the mail), i make my own connection to my mailserver, and i store the message into the Sent box, but it goes in there AS UNREAD, is there a way, to make that it gets inthere AS READ, is that addable to the imap_append function or not? if not, is there another way? scanning ALL MAILS IN SENTBOX and marking all as read using imap_setflag_full, can't be a good way i think

 

sry for my bad english,  and thx for any suggestions that might help me

oh lol, i found it already, seemed to be easier than i tought, this solved my problem:

 

 

imap_append($stream, "{name_OF_MY_MAILSERVER.net}INBOX.Sent", "$header\r\n" . "$body\r\n", "\\Seen");

 

i just added the \\seen flag to the end of function

hope i can help somebody else with this too :P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.