I'm writing a script that will get all the new emails in different accounts on the same server, check for keywords and then move each email to different account and folder in that account depending on the keywords found. I've been looking for a simple way to move the emails from one account to another, and to a folder in that account. There doesn't seem to be a simple imap_forward() function. imap_mail_move() only works within the same account. I've been searching the internet for hours looking for a way to do this without having to loop through attachments and fetching each part of the email before sending it to the destination address like I would a new email. I need to make sure no info gets lost during this process and the email arrives at the destination exactly the same as it was initially received. It can look like a forwarded message, that's fine, as long as the attachments, from address and body are intact.
Simple way to forward emails using PHP IMAP
933 views Asked by Suzanne Edelman At
1
There are 1 answers
Related Questions in PHP
- How to add the dynamic new rows from my registration form in my database?
- Issue in payment form gateway
- How to create a facet for WP gridbuilder that displays both parent and child custom fields?
- Function in anonymous Laravel Blade component
- How to change woocomerce or full wordpress currency with value from USD to AUD
- General questions about creating a custom theme Moodle CMS
- How to add logging to an abstract class in php
- error 500 on IIS FastCGI but no clue despite multiple error loggings activated
- Composer installation fails and reverts ./composer.json and ./composer.lock to original content
- How to isolate PHP apps from each other on a local machine(Windows or Linux)?
- Laravel: Using belongsToMany relationship with MongoDB
- window.location.href redirects but is causing problems on the webpage
- Key provided is shorter than 256 bits, only 64 bits provided
- Laravel's whereBetween method not working with two timestamps
- Implementing UUID as primary key in Laravel intermediate table
Related Questions in EMAIL
- Email Verification python eror
- Invalid format for email address in WordPress on Azure app service
- How to create an JSOUP element from byte array image (Load from Database)
- How can I look this email address
- Gsheet - Automatically send an email using a date & time in a Cell
- Install Postfix Mail Server
- Error 553 5.7.2 [TSS09] When Sending Emails to Yahoo and Outlook
- How to make my form send the submitted info to my email
- Cpanel filter encoding utf-8?
- Thunderbird Importing Emails imports 0 emails
- Python & Django web app - auto emails not sending
- Allowing any member of a dynamic group to send as from a shared mailbox
- How to fix "search in state AUTH" errror
- Rewriting CSS in MSO conditional comment doesn't work
- Sendgrid attachments in C#
Related Questions in IMAP
- Postal Framework crash in iPhone but runs successfully in simulator
- How to fix "search in state AUTH" errror
- Node imap mailparser error after resolve and end connection
- Python IMAP4 keeps throwing this error when I'm connecting to Outlook. Has anyone seen this error before?
- IMAP configs for Outlook using Mail-listener
- Why do certain emails go missing when attempting to fetch them using IMAP?
- Is it possible to connect to Google IMAP using OAuth and the client credentials flow (non-interactive way)?
- How to get Email Message ID from Azure email service?
- how to generate a pst from folders and eml files with python
- How can I conect multiple imap accounts to the same ost file?
- BAD User is authenticatedbut not connected Error When Connecting to IMAP with OAuth on Outlook Office 365 in PHP
- Failed IMAP Connection with Webklex PHP-IMAP and OAuth Token
- Netlify Custom Email
- PHP: IMap search not working right - Bad message number
- How to Fetch Latest Emails without Re-login Using imap_tools in Python?
Related Questions in PHP-IMAP
- BAD User is authenticatedbut not connected Error When Connecting to IMAP with OAuth on Outlook Office 365 in PHP
- Failed IMAP Connection with Webklex PHP-IMAP and OAuth Token
- Unable to get inbox from gmail using php imap
- No php 7.3 imap module in Ubuntu 18
- Unable to view e-mail attachments on iOS Mail when generated with PHP imap_mail_compose
- PHP Mailer different mail body
- PHP-IMAP by Webklex not retrieving all emails
- How to read unseen mails in PHP
- Retrieving flagged messages with webklex php-imap
- Webklex php-imap custom flags
- Access Outlook email in PHP using imap and OAuth
- What is the best php option to connect to outlook imap with oAuth?
- Capture new Email event in PHP-IMAP in laravel
- How can I read emails with Google Gmail?
- Unable to extract Unique Identity for Emails sent from Safaricom Internal Mails ie Message ID (PHP IMAP)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If you also have IMAP access to the destination mailbox, you can have two IMAP connections open simultaneously. Use one connection to read the message from the source account and the other to
imap_append()it to the destination account.You'll have to manually re-build the message headers, but that should be pretty simple, looks like you can just do this: