Announcement Announcement Module
Collapse
No announcement yet.
strange mail when sent from tomcat Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • strange mail when sent from tomcat

    Hello
    I have strange problem with sending mails.

    I'm trying to send mail with subject: asda as da ěčě ěčě and text: <html><body>asdkasjhdakjshd askjdhaskjd asdkajs a asdkas a ěčě ěč ěč ěč ěč ěč ěč ě ěčěč

    <a href="https://server/context/action.do?code=cba6b808d8f843d7afdbdd923c00591e" rel="nofollow">https://server/context/action.do?code=cba6b808d8f843d7afdbdd923c00591e</a>&lt;/body&gt;&lt;/html&gt;

    When developed it, I used junit test started from intellij idea.

    When I run the test now, I get correct mail (mail source below).
    When I deploy final web app to tomcat (5.5.20) I get strange mail. There's no BC field instead TO. No subject and strange text received. (source below).

    Code that I use for sending is:
    MimeMessage message = sender.createMimeMessage();

    MimeMessageHelper helper = new MimeMessageHelper(message, false, &quot;windows-1250&quot;

    helper.setFrom(from);
    helper.setTo(to);
    if (cc.length &gt; 0) {
    helper.setCc(cc);}
    if (bcc.length &gt; 0) {
    helper.setBcc(bcc);
    }

    helper.setSubject(subject);
    helper.setText(text, html);

    sender.send(message); //JavaMailSenderImpl

    correct mail source:
    Return-path: &lt;[email protected]&gt;
    Received: from novell.com (hoex.provo.novell.com [130.57.1.153])
    by sinclair.provo.novell.com with ESMTP; Wed, 24 Jun 2009 13:35:52 -0600
    Received: from smtp.seznam.cz not authenticated [77.75.72.43]
    by novell.com with M+ Extreme Email Engine 2008.4.debug;
    Wed, 24 Jun 2009 13:35:51 -0600
    X-MailFrom: [email protected]
    DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=seznam.cz;
    h=Receivedate:From:To:Message-ID:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Smtpd:X-Seznam-User:X-QM-Mark;
    b=ZsVqEYM1ub95oV/rYXCMT9gXN0+VMjSd4nvonHVw8NEDemXYN4aIOkk1X+0iXR2z1
    Xp3htFC72dGl3AUPltDDRTQbB89igNVvPtp1167Z61KT9J/EbVwdhSDjo4RFl1XQ2Pl
    cOqZVGdA/PLSV+Se1l6ChETsntxC6ZyoYpK2E8k=
    Received: from aaa-laptop (assigned-81-0-211-210.casablanca.cz [81.0.211.210])
    by email-relay1.go.seznam.cz (Seznam SMTPD [email protected]) with ESMTP;
    Wed, 24 Jun 2009 21:35:49 +0200 (CEST)
    Date: Wed, 24 Jun 2009 20:35:49 +0100 (GMT+01:00)
    From: [email protected]
    To: [email protected]
    Message-ID: &lt;[email protected]&gt;
    Subject: =?windows-1250?B?YXNkYSBhcyBkYSDt4f3s7Zrh/ejs7Zog7Jro7eH97Jrt?=
    MIME-Version: 1.0
    Content-Type: text/html;charset=windows-1250
    Content-Transfer-Encoding: quoted-printable
    X-Smtpd: [email protected]
    X-Seznam-User: [email protected]
    X-QM-Mark: email-qm3&lt;214459661&gt;

    &lt;html&gt;&lt;body&gt;asdkasjhdakjshd askjdhaskjd asdkajs a asdkas a =E1=EC=FD=9A=9E=
    =E8=EC =EC=E1=9A=FD=E8=9E =EC=9A=E1=E8=FD =9E=E1=EC=9A=E8=9E =E1=EC=9E=E8=
    =9A =E1=EC=9E=9A=E8=E1 =9E=EC=9A=E1=E8=FD =9E=E1=EC=9A=9E =E1=FD=EC=9A=9E=
    =E8=E1=EC=9A=9E=E8=E1

    <a
    3c00591e" rel="nofollow">https://server/context/action.do?cod...43d7afdbdd923=
    c00591e</a>&lt;/body&gt;&lt;/html&gt;

    bad mail source:
    Return-path: &lt;[email protected]&gt;
    Received: from novell.com (lasca.provo.novell.com [130.57.1.152])
    by sinclair.provo.novell.com with ESMTP; Wed, 24 Jun 2009 13:28:03 -0600
    Received: from smtp.seznam.cz not authenticated [77.75.72.43]
    by novell.com with M+ Extreme Email Engine 2008.4.debug;
    Wed, 24 Jun 2009 13:28:03 -0600
    X-MailFrom: [email protected]
    Received: from aaa-laptop (assigned-81-0-211-210.casablanca.cz [81.0.211.210])
    by email-relay2.go.seznam.cz (Seznam SMTPD [email protected]) with ESMTP;
    Wed, 24 Jun 2009 21:28:01 +0200 (CEST)
    X-Smtpd: [email protected]
    X-Seznam-User: [email protected]
    X-QM-Mark: email-qm2&lt;435151721&gt;

    &lt;html&gt;&lt;body&gt;asdkasjhdakjshd askjdhaskjd asdkajs a asdkas a =E1=EC=FD=9A=9E=
    =E8=EC =EC=E1=9A=FD=E8=9E =EC=9A=E1=E8=FD =9E=E1=EC=9A=E8=9E =E1=EC=9E=E8=9A=
    =E1=EC=9E=9A=E8=E1 =9E=EC=9A=E1=E8=FD =9E=E1=EC=9A=9E =E1=FD=EC=9A=9E=E8=E1=
    =EC=9A=9E=E8=E1

    <a
    c00591e" rel="nofollow">https://server/context/action.do?cod...d7afdbdd923c0=
    0591e</a>&lt;/body&gt;&lt;/html&gt;

    I'm not able to resolve problem.
    Can someone give me an advice?

    Thanks
    blaf

  • #2
    perhaps tomcat sets the default charset different than your ide?

    Comment

    Working...
    X