0dteam / Phishing-Reporter

An Outlook Plugin to report phishing emails easier and provides full integration with GoPhish.
GNU General Public License v3.0
47 stars 13 forks source link

Header info as attachment #3

Closed sebaeee closed 3 years ago

sebaeee commented 3 years ago

Hi, this isn´t an issue. How can I send the information in bode as txt attachment with the eml (2 attachment in total) I see this code, I need to put this on a second txt attachment.

                        // Prepare the email body
                        reportEmail.Body = GetCurrentUserInfos();
                        reportEmail.Body += "\n";
                        reportEmail.Body += GetBasicInfo(mailItem);
                        reportEmail.Body += "\n";
                        reportEmail.Body += GetURLsAndAttachmentsInfo(mailItem);
                        reportEmail.Body += "\n";
                        reportEmail.Body += "---------- Headers ----------";
                        reportEmail.Body += "\n" + reportedItemHeaders;
                        reportEmail.Body += "\n";
                        reportEmail.Body += GetPluginDetails() + "\n\n";

                        reportEmail.Save();
                        //reportEmail.Display(); // Helps in debugginng
                        reportEmail.Send(); // Automatically send the email
sebaeee commented 3 years ago

I can try to put all reportEmail.Body on a txt file and then attach to the report email, but I don´t know if this is the best way, or create something on memory.

0dteam commented 3 years ago

You can find few examples on how to acheive this: https://stackoverflow.com/questions/5336239/attach-a-file-from-memorystream-to-a-mailmessage-in-c-sharp https://stackoverflow.com/questions/38099292/writing-list-of-strings-into-text-file-adding-as-attachment-to-the-mail-using-c

sebaeee commented 3 years ago

Thanks