Open AndoKarim opened 6 years ago
Hi Andro. Do you see this image in the mailhog webui oder in your mail-client?
Hello, I see it in the mailhog webui. I tried with another SMTP server (maildev) and I don't have this problem.
AFAIK know the webui has some trouble with embedded images. https://github.com/mailhog/MailHog/issues/27
Can you add the source of the image for testing and reproduction please?
@tyndyll did you try the one from #27 -> https://pastebin.com/KnenaHvR already?
Not yet :)
Thanks for all the work on this project! MailHog seems awesome so far! It's too bad this issue has dragged out though I understand how busy contributors get and definitely appreciate all the work you and others do. Another example in case you need it (Let me know if there is something else you expected for reproduction purposes):
Content-Type: multipart/alternative; boundary="--_NmP-61cad9cddc4b2cd8-Part_1" Date: Mon, 09 Mar 2020 12:29:34 +0000 From: noreply@meditech.com MIME-Version: 1.0 Message-ID: b211a1a0-c6f6-58b0-f757-51e8ccb58237@meditech.com Received: from [127.0.0.1] by dev-mailhog-684549c47f-rvbv7 (MailHog) id Cohue0EqF4-5G5id45kHDEX44wD1Phw9mY89NSVu7gc=@dev-mailhog-684549c47f-rvbv7; Thu, 27 Feb 2020 23:25:50 +0000 Return-Path: noreply@meditech.com Subject: Test Email To: mramos@meditech.com
----_NmP-61cad9cddc4b2cd8-Part_1 Content-Type: text/plain Content-Transfer-Encoding: 7bit
This is a test email. ----_NmP-61cad9cddc4b2cd8-Part_1 Content-Type: multipart/related; type="text/html"; boundary="--_NmP-61cad9cddc4b2cd8-Part_3"
----_NmP-61cad9cddc4b2cd8-Part_3 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
This is a test email.
i am having similar problems, only the image doesn't render in Mailhog at all. i just get the base64 encoded version. i am aware of the browser problems, but my concern is that it doesn't render period.
it should also be noted that when i do embed the image, the HTML breaks and all the styling goes out the window.
@MRamos62786 An example of the correct e-mail structure:
multipart/mixed
├── multipart/related
│ ├── multipart/alternative
│ │ ├── text/plain
│ │ └── text/html
│ └── image/png
└── application/pdf
You can't have related
part in alternative
part (in your case you can omit mixed
node entirely because all your attachments are embedded images but you still must put alternative
part in related
and not the other way around). Your example doesn't render correctly in bunch of e-mail clients.
@MRamos62786 How have you solved it? I get exactly the same mail structure when using MailMessage
in .NET, but I have no control to change this structure.
@Duke482132 I have not solved this and this has dropped significantly on my todo list. I'm using nodemailer@6.6.4 and looking at the changelog for that module, it doesn't appear that anything has changed to have resolved this issue. My guess is that nodemailer would need to be updated to create the structure @cprn mentioned, maybe this issue will resolve it. Sorry I can't be more help, Good Luck!
@Duke482132 What @MRamos62786 said - it's incorrectly generated e-mail content, not a MailHog issue. This issue should be closed. Push the one in nodemailer repo.
@cprn @MRamos62786 I switched to MimeKit and MailKit and it works like it should with proper structure.
Hello everyone, I'm using NodeMailer with Mailhog to test my mail. The objective is to send an HTML email with embedded image. I used the cid in NodeMailer and put an img tag with that cid. The image is displayed, no problem, but I see a lot of useless text in the mail as you can see in the screen. Do you have an idea about the problem ? When I send something without attachment I don't have it (Only HTML).
Thank you.