I want to create IMail and save it in the database. then another process will send that message. So my question is when generating IMail how I can create UID? So I can store it in the database with Imail and I can use it for future reference..
UID is assigned by IMAP server when message is uploaded, or when it is received and put in INBOX by SMTP server.