Open konst123 opened 7 years ago
Hey, I have to check. I'll let you know asap
It is strange, but if I deploy the same app on the server in use text/html
:
Content-Type: multipart/mixed;
boundary="----=_Part_0_1245359920.1498747402081"
X-Yandex-Forward: 0fdc2ca0db90b35549dc87b16843c851
------=_Part_0_1245359920.1498747402081
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<!doctype html>
<html>
<body>
But when I test the same code locally on my Windows PC, it send it as text/plain
as in the example above.
Is the server running Linux or Windows?
Linux. It is Google App engine flexible environment.
Can you provide a reproducible example. I'd like to see if it provides the same output on my Mac
Closing because of missing feedback
I think this is the problem described here. https://stackoverflow.com/questions/5028670/how-to-set-mimebodypart-contenttype-to-text-html
It sends html in the prod server, but do not send html in a unit test.
They recommend using MimeMessage.saveChanges()
@konst123 thanks for poiting to that SO answer. I updated master. Could you try to see if master now solves your issue?
Best Roberto
Thank you. I tried it but it doesn't help - I have the same result. The problem maybe somewhere else.
Hi, I have the same problem. I use the mustache html template example (version 0.6.3). When I use the spring-boot app with locally (mvn appengine:run) the html message shows perfectly. But, when I deploy the app to google app engine, the message show text/plain content-type (in gmail web client). The html template starts with <!doctype html>.
Thanks, Attila
@drmzperx so it seems a problem of environment configuration. I'm sorry but I can only debug issues on my local environment. I think you will need to understand what's different in the settings in your local env and in the remote one.
I create an Email via
DefaultEmail.builder()
and send it viaemailService.send
with a Freemarker template (without attachments). The problem is that theContent-Type
is set totext/plain
, nothtml
:I can also see that the MimeMessage returned from
emailService.send
has only one part withobjectMimeType
set totext/plain; charset=UTF-8
.I tried to set
customHeaders
but it does not help.