[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Problem using SMTP  XML
Forum Index » Java Programming
Author Message
colossusdub

Newbie

Joined: 03/15/2010 06:31:54
Messages: 3
Offline

Hi guys,

I am experiencing problems when trying to send emails using the smtp. I am using the code below but am getting the following errors:

220 hawk.dcu.ie ESMTP Service ready
HELO localhost.localdomain
250 hawk.dcu.ie
MAIL FROM: adam.keaney2@mail.dcu.ie
501 Syntax error in parameters or arguments to MAIL command
RCPT to: adam.keaney2@mail.dcu.ie
501 Syntax error in parameters or arguments to RCPT command
DATA
503 DATA command outside of MAIL transaction
Subject: Test Email
Content-type: text/html; charset="us-ascii"
<b>You got mail!</b>
.
500 Subj command unrecognized


stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 751
Location: Superior, CO, USA
Offline

Do you really want to implement the entire SMTP protocol yourself? The problem is that you're not enclosing the "from" address in < and > which is required by the RFC.

The JavaMail API is very powerful and can handle much of this for you. Unless this is a school project, I'd strongly encourage you to use existing libraries rather than roll your own.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
colossusdub

Newbie

Joined: 03/15/2010 06:31:54
Messages: 3
Offline

Thanks, I managed to get it sorted. I am new to this whole java language so it's quite confusing for me!
 
Forum Index » Java Programming
Go to:   
Powered by JForum 2.1.8 © JForum Team
This site built by Scott Dunbar of Xigole Systems. © 2005-2010 - Scott Dunbar
Java and the Java Get Powered logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
hotjoe.com and xigole.com have no affiliation with Sun Microsystems, Inc.