hello, I am trying to send an e-mail with opencms 6.2.2, but I cannot add attached files to him, I have proven with the following lines of code:<br><br><pre> try<br> {<br> CmsHtmlMail mail = new CmsHtmlMail();<br>
EmailAttachment attachm = new EmailAttachment();<br><br> attachm.setName("file.txt");<br> attachm.setDisposition(EmailAttachment.ATTACHMENT);<br> attachm.setDescription("File with text");
<br> attachm.setPath("C:\\file.txt");<br><br> mail.setFrom("<a href="mailto:from@domain.com">from@domain.com</a>");<br> mail.addTo("<a href="mailto:to@domain.com">to@domain.com</a>");
<br> mail.setSubject("subject");<br> mail.setMsg("message");<br><br> mail.attach( attachm );<br><br> mail.send();<br><br> out.println("<h1>Correct</h1>");
<br> }<br> catch (MessagingException e)<br> {<br> out.println(e.toString());<br> }</pre><br><br><br>and it gives east error me: <br><br><br><pre>javax.mail.MessagingException: Cannot attach file "C:\file.txt"; nested exception is:
java.io.IOException: "C:\file.txt" does not exist </pre>
<div><br><br>nevertheless, in Eclipse, this code works correctly. Also I have tried to send a file that this in the VSF and does not work </div>
<div>either. If somebody knows like solving to my problem estaria him very thanked for</div>
<div><br><br>Thank you very much by your aid. A greeting.</div>