Closed ChrisBakerIKinema closed 2 years ago
Hi @ChrisBakerIKinema,
Can you show me the HTML returned by:
dlg.textEditMessage->toHtml()
?
Does it look similar to the HTML from the example:
html.setHtml("<h1> Hello! </h1>"
"<h2> This is the first image </h2>"
"<img src='cid:image1' />"
"<h2> This is the second image </h2>"
"<img src='cid:image2' />");
?
Thanks, Attila
I have to be careful here not to give away anything confidential.
It looks like HTML.
I tried pasting it but it didn't come out,
It did look complicated, it was 60k worth of HTML.
@ChrisBakerIKinema, ok. I understand this.
I would recommend to start with a simple HTML, with just a single <img>
tag. Make sure the src='cid:image001'
argument matches the content id set on the MimeInlineFile
:
mai1.setContentId("image001");
If this works, you can build the rest of the HTML around it.
Btw, Gmail has an "Show original" option to view the raw email. This usually helps to find out what's wrong with the email.
Thanks for the help, I'll give that a go. My HTML is poor but I know Word can save in HTML format.
Also notice the line...
smtp.setAuthMethod(SmtpClient::AuthLogin);
I does not appear in your examples but on my computer it didn't work without it.
I tried a simple example and it did embed correctly thanks.
I have tried the following example and I can't get it to work..
https://github.com/bluetiger9/SmtpClient-for-Qt/wiki/Examples#example3
I have a HTML email with 2 images in it. If I email to gmail the images do appear as attachments, if I email to my own outlook I don't even get that.
Here is my code...