简体   繁体   中英

MimeMessage: Content sent different from content received

I have a strange behavior, while Im sending a mail : This is my code :

mailMessage.setSubject(subject);
mailMessage.setHeader("Content-Type", "text/html; charset=UTF-8" );
mailMessage.setContent(content, "text/html");       
Transport transport = mailSession.getTransport();       
transport.connect();        transport.sendMessage(mailMessage,mailMessage.getRecipients(Message.RecipientType.TO));
        transport.close();

This is what I send: (Only the form is concerned by the problem)

<form method="POST" action="localhost/Test/NotConnectedSetter.validateEmail" >

This is what I receive:

<form id="yui_3_16_0_1_1403504390037_61051" onsubmit="return theMainWindow.showFormWarning(this)" method="POST" target="_blank">

Lots of things are added (What I don't care) but my action is deleted. I get the mail on yahoo (I'm not sure it's important, but who knows). This is my only form in the page, I have no idea how this happens. If anyone can help... Thanks

Well, I forgot the "form" thing, since Yahoo will warn user to click on it. I will work with customers, I don't want them to be afraid by clicking on something for my website Otherwise, I reproduced the same problem with and the problem definitely came from yahoo! Then, there is already a question this point. Answer is here : yahoo disable links when sent from smtpclient .net I tested it (short answer : add http/https to your url), and it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM