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]](/images/avatar/a87ff679a2f3e71d9181a67b7542122c.png)
Joined: 06/22/2005 14:51:37
Messages: 849
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.
|