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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.