Results 1 to 7 of 7
- 05-02-2010, 11:16 PM #1
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
email received has To: undisclosed-recipients:
I built an email simple only send , app
using code like below but email received has To: undisclosed-recipients:
not the inserted real email well, what other way exist to send email in Java SE with To, the actual To field contents?
Java Code:88. public void sendMail() 89. { 90. try 91. { 92. Socket s = new Socket(smtpServer.getText(), 25); 93. 94. InputStream inStream = s.getInputStream(); 95. OutputStream outStream = s.getOutputStream(); 96. 97. in = new Scanner(inStream); 98. out = new PrintWriter(outStream, true /* autoFlush */); 99. 100. String hostName = InetAddress.getLocalHost().getHostName(); 101. 102. receive(); 103. send("HELO " + hostName); 104. receive(); 105. send("MAIL FROM: <" + from.getText() + ">"); 106. receive(); 107. send("RCPT TO: <" + to.getText() + ">"); 108. receive(); 109. send("DATA"); 110. receive(); 111. send(message.getText()); 112. send("."); 113. receive(); 114. s.close(); 115. } 116. catch (IOException e) 117. { 118. comm.append("Error: " + e); 119. } 120. } 121. 122. /** 123. * Sends a string to the socket and echoes it in the comm text area. 124. * @param s the string to send. 125. */ 126. public void send(String s) throws IOException 127. { 128. comm.append(s); 129. comm.append("\n"); 130. out.print(s.replaceAll("\n", "\r\n")); 131. out.print("\r\n"); 132. out.flush(); 133. } 134. 135. /** 136. * Receives a string from the socket and displays it in the comm text area. 137. */ 138. public void receive() throws IOException 139. { 140. String line = in.nextLine(); 141. comm.append(line); 142. comm.append("\n"); 143. }
- 05-04-2010, 05:01 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
You mean that you want to send mails without let them who send it?
- 05-04-2010, 05:49 AM #3
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
No, I mean:
The (received) email I test it to, I send with mine address(To) come as:
1)no subject
2)To: field equals>undisclosed-recipients:
I want To: shown my own address as destinated address or in case send email elesewhere person, the destinated address of him(his address)
and
Subject field to have a relative subject...well?
- 05-04-2010, 09:40 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 05-05-2010, 07:23 PM #5
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
I must use for the requested point, package JavaMail API???
HOW MANY WAYS EXIST IN SENDING JAVA SE EMAIL ?Java Code:105. send("MAIL FROM: <" + from.getText() + ">"); 106. receive(); 107. send("RCPT TO: <" + to.getText() + ">");
I must use for the requested point, package JavaMail API???
exist and other ways to achive this?
after fwd received email I get in body:
and in subject:Java Code:webmaster@poliscarhire.eu // these 2 lines appear by default after fwd any msg webmaster@poliscarhire.com -----Original Message----- From: a080725@cytanet.com.cy [mailto:a080725@cytanet.com.cy] Sent: Monday, May 03, 2010 12:20 AM To: undisclosed-recipients: Subject: test one two jnjnjnm ,mnmnmn,m ,n,mn,mn, ,m,mnmn nm,mnmn nmn,n,
Java Code:FW:
- 05-06-2010, 05:34 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 05-06-2010, 08:20 AM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Reg : PGP Encryption using Recipients Key
By Deepa in forum New To JavaReplies: 0Last Post: 08-31-2009, 12:28 PM -
detecting data received is malicious or not
By prashant in forum NetworkingReplies: 2Last Post: 02-02-2009, 03:58 PM -
saving bytes received in different request
By renuka_anil in forum Java ServletReplies: 18Last Post: 12-26-2008, 12:12 PM -
send email using apache commons email
By jnamendi in forum JavaServer Faces (JSF)Replies: 0Last Post: 10-14-2008, 05:55 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks