File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Java and SMTP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Java and SMTP" Watch "Java and SMTP" New topic
Author

Java and SMTP

Matt Millar
Greenhorn

Joined: Oct 16, 2012
Posts: 11
Hello I am trying to learn how SMTP works and I went with java for my test. I have been following some examples and putting together a Frankenstein kinda code but it works to a degree. Everything works fine up till you try to send a email I think. I gets down to the mail FROM part then gives me this error




I am stumped on it. It look like the one online that I used and from my book but it does not work. Am i missing something here? Thanks for any help with this.
Here my code

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Looks like you're trying to connect to a mail server which requires a secure connection. That's going to be a complication which you don't need while you're learning the basics of SMTP. So I suggest you test with a different server.
Matt Millar
Greenhorn

Joined: Oct 16, 2012
Posts: 11
Thank you I didnt even think of that. Could you suggest one that would work?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I would suggest running your own. (That also allows you to get experience with the server side of SMTP.) Apache James is an open-source SMTP server written in Java, you could use that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java and SMTP
 
Similar Threads
SMTP java program...
Not able to send a mail using JAVA code
File transfer using FTP
send email
error while sending mail using socket class