How to save journal as draft in PHP?

Save email as draft in php

  • The past few days I've been trying to find out how I can save emails as drafts using php. I've created an emailaddress that uses imap (and resides on the same server). What I would like to do is to use php to create an email and store it in the drafts folder. These emails would then be recognized by the email client (ms office outlook in this case) so they can be editted and send from the email client. I've found some interesting information about the imap functions from php, they let you send mail, but I can't really figure out how to store them in the drafts folder (to which I have write access). I can actually find and read the emails, I save as drafts in my email client, using my ftp connection. However they make use of UID and message-ID's and such which I don't understand where they come from. My questions: - how could I create email drafts - How does a new UID or message-ID get created, and how would I use them for my email-draft file? Help is much appreciated, thanks. Yorian

  • Answer:

    Look into http://php.net/manual/function.imap-setflag-full.php. there's a \draft flag.

Yorian at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

Have you checked if the proper extension is installed? To use the php imap functions the php5-imap extension must installed. You can check this by using phpinfo(). When there stands nothing about "imap", the extension is not installed.

elpado

AFAIK you can use imap_append() to store the mail in the INBOX.Draft mailbox (http://www.php.net/manual/en/function.imap-append.php)

Freeman Latif

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.