[opencms-dev] Email format trouble
Sébastien Bianco
s.bianco at eurelis.com
Tue Feb 16 18:20:59 CET 2010
Hello
I'll try to send HTML email with attached plain text message. I receive both, but the first element seen is the plain text. The HTML is attached.
I'll would like to have the opposite (first HTML, plain text attached). Is it a way to to this ?
We have already done some similar things in previous project without problem. We think that the problem starts to occurs when changing from common-mail.1.0.jar to common-mail.1.1.jar. Nevertheless I didn't find any mention of such bug on Google (but maybe I missed out one).
Here is my code to create then send the mail :
org.opencms.mail.CmsHtmlMail htmlMailConfirm = new org.opencms.mail.CmsHtmlMail();
//htmlMailConfirm.setMsg(text);
htmlMailConfirm.setTextMsg(text);
htmlMailConfirm.setHtmlMsg(html);
htmlMailConfirm.setDebug(true);
//htmlMailConfirm.setTextMsg(text);
htmlMailConfirm.setSubject((String)pageContext.getAttribute("confirm_subject"));
htmlMailConfirm.addTo(user_email);
htmlMailConfirm.send();
Here are the logs I got :
DEBUG: JavaMail version 1.4.1
DEBUG: not loading file: C:\dev\java\jdk1.5.0_16\jre\lib\javamail.providers
DEBUG: java.io.FileNotFoundException: C:\dev\java\jdk1.5.0_16\jre\lib\javamail.providers (Le fichier spécifié est introuvable)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: not loading file: C:\dev\java\jdk1.5.0_16\jre\lib\javamail.address.map
DEBUG: java.io.FileNotFoundException: C:\dev\java\jdk1.5.0_16\jre\lib\javamail.address.map (Le fichier spécifié est introuvable)
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "xx.xx.xx.xx", port 25, isSSL false
220 chronos.eurelis.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Tue, 16 Feb 2010 18:10:59 +0100
DEBUG SMTP: connected to host " xx.xx.xx.xx ", port: 25
EHLO dev19
250-chronos.eurelis.com Hello [xx.xx.xx.xx]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK
DEBUG SMTP: Found extension "TURN", arg ""
DEBUG SMTP: Found extension "SIZE", arg ""
DEBUG SMTP: Found extension "ETRN", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "8bitmime", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "VRFY", arg ""
DEBUG SMTP: Found extension "X-EXPS", arg "GSSAPI NTLM LOGIN"
DEBUG SMTP: Found extension "X-EXPS=LOGIN", arg ""
DEBUG SMTP: Found extension "AUTH", arg "GSSAPI NTLM LOGIN"
DEBUG SMTP: Found extension "AUTH=LOGIN", arg ""
DEBUG SMTP: Found extension "X-LINK2STATE", arg ""
DEBUG SMTP: Found extension "XEXCH50", arg ""
DEBUG SMTP: Found extension "OK", arg ""
DEBUG SMTP: Attempt to authenticate
AUTH LOGIN
334 VXNlcm5hbWU6
bmV3c2xldHRlcg==
334 UGFzc3dvcmQ6
bmV3c2xldHRlcg==
235 2.7.0 Authentication successful.
DEBUG SMTP: use8bit false
MAIL FROM:<contact at eurelis.com>
250 2.1.0 contact at eurelis.com....Sender OK
RCPT TO:<s.bianco at eurelis.com>
250 2.1.5 s.bianco at eurelis.com
DEBUG SMTP: Verified Addresses
DEBUG SMTP: "s.bianco at eurelis.com" <s.bianco at eurelis.com>
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Date: Tue, 16 Feb 2010 18:10:57 +0100 (CET)
From: "contact at eurelis.com" <contact at eurelis.com>
To: "s.bianco at eurelis.com" <s.bianco at eurelis.com>
Message-ID: <15397147.46.1266340257812.JavaMail.SYSTEM at dev19>
Subject: [FFC] reinit mot de passe - confirmez votre adresse
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_44_10670312.1266340257796"
------=_Part_44_10670312.1266340257796
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
blabla http://localhost:8080/ffc/opencms/fr/annexes/retrouver_votre_mot_de_passe.html?cuuid=7452c6f9-01be-11df-aa59-090e3f73715e
------=_Part_44_10670312.1266340257796
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<p> Blablabla</p>
<p> </p>
<p>http://localhost:8080/ffc/opencms/fr/annexes/retrouver_votre_mot_de_passe.html?cuuid=7452c6f9-01be-11df-aa59-090e3f73715e</p>
------=_Part_44_10670312.1266340257796--
.
250 2.6.0 <15397147.46.1266340257812.JavaMail.SYSTEM at dev19> Queued mail for delivery
QUIT
Sébastien BIANCO
Ingénieur développement
EURELIS
AGITATEUR DE TECHNOLOGIES
Tel : +33 (0)1 49 97 20 20
Fax : +33 (0)1 47 68 20 19
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100216/71e4b5ee/attachment.htm>
More information about the opencms-dev
mailing list