Skip to content
Advertisement

How to get the message body from PHPMailer?

I use PHPMailer to send email via SMTP. It works, but it doesn’t save the sent emails in

sent items. I want to make to sent emails in the sent items, any idea?

I know can use imap_append function to achieve it. But, how to do that?

The PHPMailer seems doesn’t has the function to return the $message.

JavaScript

How to get the message body from PHPMailer?

Advertisement

Answer

The instance variables from PHPMailer are all public. Looking at the source you can just use:

JavaScript

If you want the plain body including the all boundaries you could also use:

JavaScript

See: http://phpmailer.svn.sourceforge.net/viewvc/phpmailer/trunk/phpmailer/class.phpmailer.php?revision=452&view=markup

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement