aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Send mail from local machine mail server to gmail or other mail server in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Send mail from local machine mail server to gmail or other mail server in java" Watch "Send mail from local machine mail server to gmail or other mail server in java" New topic
Author

Send mail from local machine mail server to gmail or other mail server in java

R K Sharma
Greenhorn

Joined: Aug 07, 2011
Posts: 12


Mercury Server Log



Server Debug Output




But, I'm not receiving any mails. Anyone help me to resolve this issue.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Probably you aren't receiving any e-mails from that code because your e-mail server (the one you sent the e-mails to) doesn't trust your program's e-mail server (the one you're sending the e-mails from). Your server will be doing something like examining the from-address on the e-mail and seeing if it came from the actual server for the from-address's domain. If it didn't, then it considers the e-mail to be a forgery.

And since the from-address is "test1@localhost", it's pretty clearly a forgery. You need to do two things: use a from-address which belongs to a domain, and send the e-mail from that domain's e-mail server.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Send mail from local machine mail server to gmail or other mail server in java