I am developing a simple webmail client for IMAP-based email services using PHP's IMAP library, and I was wondering if there was any way to specify the SMTP server to use when sending an outgoing message, so that the message will be placed in the user's Sent mailbox when they are logged into their IMAP account. I saw that their is an imap_mail() function however it looks from the docs like it is just basically an alias for the normal mail() function, or am I wrong in assumming that?
+2
A:
Why don't you use a full featured class for this function, like PHPMailer?
Vasileios Lourdas
2010-09-29 20:08:37
I do use PHPMailer and its a great class, however it does not implement any type of function where an outgoing message is copied to an IMAP sent mailbox, as far as I know.
Bill Dami
2010-09-29 20:25:53
+1
A:
Saving a copy to the Sent Mail folder is a function of IMAP, and is completely unrelated to queuing the message for delivery via SMTP. I.e., your code will have to do both operations separately -- one does not imply the other.
Alex Howansky
2010-09-29 20:09:04
Yeah, thats what I figured. So then how would I go about replicating IMAP's function of saving a copy to the sent folder in PHP?
Bill Dami
2010-09-29 20:24:45
You just connect to the IMAP server and write the message to the desired folder, presumably via imap_append().
Alex Howansky
2010-09-29 20:29:03
Ah never noticed that imap_append() function before, that should do the trick. Thanks :-)
Bill Dami
2010-09-29 20:33:16