zsedc Posted October 5, 2008 Share Posted October 5, 2008 Hi I am looking for simple way to forward emails (also HTML and attachments) with IMAP (or POP3) using PHP. There must be the possibility to do it within a few lines of code - i could not find. Thanks for your help. Pawel Link to comment https://forums.phpfreaks.com/topic/127133-forward-email-with-imap-in-php/ Share on other sites More sharing options...
zsedc Posted October 6, 2008 Author Share Posted October 6, 2008 hmmm... so if there is no simply way maybe someone know a short difficult way? Collect all informations with IMAP and than just use system function mail ? Link to comment https://forums.phpfreaks.com/topic/127133-forward-email-with-imap-in-php/#findComment-658543 Share on other sites More sharing options...
kenrbnsn Posted October 7, 2008 Share Posted October 7, 2008 We don't write code for you in this forum. We help you with code you've already written. If you've tried and failed to solve this problem, please post the code you're having problems with. If you want someone to write this for you, post in the freelancing area. Ken Link to comment https://forums.phpfreaks.com/topic/127133-forward-email-with-imap-in-php/#findComment-658709 Share on other sites More sharing options...
zsedc Posted October 10, 2008 Author Share Posted October 10, 2008 I do not think that there is a code to write. There is probably only one line of code required to do this. The code i have: $num is a message number $PHP_AUTH_USER="USER"; $PHP_AUTH_PW="PASS"; $link=imap_open("{poczta.o2.pl:110/pop3}INBOX", $PHP_AUTH_USER, $PHP_AUTH_PW); $header=imap_header($link,$_GET['num']); $body=imap_body($link,$_GET['num']); Now I would like to use standard Unix function mail() to send this email, so it will be forwarded. mail('[email protected]', 'any subject', $body, $header) It works for plain text messages, but I do not know how to do it when there is HTML or attachments? I guess there is a problem with $header. I was also trying imap_mail_compose() or imap_mail(),but I didn't get any successful solution. Does any one could help? Thanks a lot Pawel Link to comment https://forums.phpfreaks.com/topic/127133-forward-email-with-imap-in-php/#findComment-662020 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.