PHP Classes

Using MIMEDecode and MIMEmessage together

Recommend this page to a friend!

      MIME E-mail message sending  >  All threads  >  Using MIMEDecode and MIMEmessage...  >  (Un) Subscribe thread alerts  
Subject:Using MIMEDecode and MIMEmessage...
Summary:How to resend a message with few changes
Messages:4
Author:Matthew White
Date:2016-10-15 12:37:56
 

 


  1. Using MIMEDecode and MIMEmessage...   Reply   Report abuse  
Picture of Matthew White Matthew White - 2016-10-15 12:37:56
Hello;

I'm currently using both the MIMEDecode and MIMEMessage to process some email for a local organisation.

One of the requirements is to resend an email but with a modified To: field but for the rest of the email to remain unchanged... as if the original author had used the modified to: field.

I've been able to forward the email as an attachment; but as the APIs aren't quite symetric it's not as easy to work out how to do the resend simply.

Suggestions welcome as to an approach here. (Ideally I wouldn't be using a php script but the are other requirements that mean the hosting email forwarding can't be used sadly).

Thanks Matthew

  2. Re: Using MIMEDecode and MIMEmessage...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-10-15 20:26:35 - In reply to message 1 from Matthew White
I already thought and adding a function to MIME message to take MIME parser output and rebuild the message. So this is a useful idea that other people may be interested.

I will try to make some time to work on that.

  3. Re: Using MIMEDecode and MIMEmessage...   Reply   Report abuse  
Picture of Matthew White Matthew White - 2016-10-16 07:52:01 - In reply to message 2 from Manuel Lemos
Thank you for the response, currently I'm working on taking the headers/bodies that I suspect might come in and then setting on the out message. So far ok - but suspect one email will come in that has something unusual :-)

If you have a beta version would be happy to try it!

Matthew

  4. Re: Using MIMEDecode and MIMEmessage...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-10-16 09:24:34 - In reply to message 3 from Matthew White
It it is just a matter of replacing the To: header, you may just find the header line and replace it with whatever values. Just keep in mind that headers may span multiple lines.