gsb Posted June 29, 2006 Share Posted June 29, 2006 I am trying to move e-mails from one account, say info@my-domain.com to another user account like, salesman@my-domain.com.[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=24808&st=0&p=90240entry90240\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...240entry90240[/a]I did a search and found one (old) thread concerning imap_mail_move() which does not seem to address multiple accounts but rather the sub-boxes under the original account.A little direction, similar thread, or example would help.Regards,gsb Quote Link to comment https://forums.phpfreaks.com/topic/13236-moving-e-mails-between-local-accounts/ Share on other sites More sharing options...
xyn Posted June 29, 2006 Share Posted June 29, 2006 I'm not sure if this will help you but the only example I can produce is:imap_mail_move($mbox,$movmsgid,'INBOX.send'); Quote Link to comment https://forums.phpfreaks.com/topic/13236-moving-e-mails-between-local-accounts/#findComment-50968 Share on other sites More sharing options...
gsb Posted June 29, 2006 Author Share Posted June 29, 2006 Thank you Ashh for a quick response but I do not believe that is going to help me.I am trying not to use a forward or actual send that would change the headers, but that is the only solution I have come up with.Regards,gsb Quote Link to comment https://forums.phpfreaks.com/topic/13236-moving-e-mails-between-local-accounts/#findComment-50991 Share on other sites More sharing options...
nogray Posted June 29, 2006 Share Posted June 29, 2006 It depends how your server is set up to store the mail, most servers will store each account (and folder) in a text file. Some will store each message in a folder for that email account. If you have access to your mail folder, you can read the files using PHP and extracting any message you want. You can also place it in another email account as well. Quote Link to comment https://forums.phpfreaks.com/topic/13236-moving-e-mails-between-local-accounts/#findComment-51037 Share on other sites More sharing options...
gsb Posted June 30, 2006 Author Share Posted June 30, 2006 Thank you nogray,This sounds like a possible solution.I use a commercial server, "Lunar Pages" and will need to learn if I have such access or not.Is there a "standard" location where I might look for such files?Yes this is a dumb question I guess, but at this point for me, worth asking.Regards,gsb Quote Link to comment https://forums.phpfreaks.com/topic/13236-moving-e-mails-between-local-accounts/#findComment-51376 Share on other sites More sharing options...
gsb Posted June 30, 2006 Author Share Posted June 30, 2006 Yes was a dumb question.I found the mail storage and it is a text file as nogray said above.Which leads me to another question:Does anyone have a good idea of how to extract an email from one such file and insert it into another?I'm thinking that the imap functions do well at the extraction but I am unsure as to the insertion operation into another's input mail box.Regards,gsb Quote Link to comment https://forums.phpfreaks.com/topic/13236-moving-e-mails-between-local-accounts/#findComment-51388 Share on other sites More sharing options...
nogray Posted June 30, 2006 Share Posted June 30, 2006 If it's one file message will be seprated by two line breaks and the From email@domain.comsome the file might look like thisFrom someone@somewhere ......... more headers ....messageFrom someone@somewhere ......... more headers ....messageFrom someone@somewhere ......... more headers ....messageusually the first section is the setting of the email account, so you can split the text file using "\n\nFrom" as the sperator and check each if for whatever you want it to match (the email, subject, etc)To add the message to another account, you can just place it in the bottom of that file (just make sure it has \n\n before it and after) you should include the headers for it to show up in the email manager (I think).You'll need to make some tests and test some more for this to work like you want it. Quote Link to comment https://forums.phpfreaks.com/topic/13236-moving-e-mails-between-local-accounts/#findComment-51427 Share on other sites More sharing options...
gsb Posted June 30, 2006 Author Share Posted June 30, 2006 Thank you again.Yes I am familiar with the 2-newline breaks separator, it bit me some years ago now.This looks quite doable from here now thanks to your guidance.Regards,gsb Quote Link to comment https://forums.phpfreaks.com/topic/13236-moving-e-mails-between-local-accounts/#findComment-51457 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.