SMTP-auth via telnet

hi there

im coding an smtp client in java and need to find out how to send SMTP authentication to servers. i know its a base64 encoded challenge / response - i just dont know what to send it! ive looked through the rfc 2554 but cant find it (maybe ive been working on this too long and have overlooked it).

can anyone help?

thanks in advance
LVL 14
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Link to SMTP commands...

Link to sample Java App using these commands..

Is this what you are looking for?

Dan Soto
New Orleans, LA
grimkinAuthor Commented:

thanks for your comments. i already have the smtp client coded as far as simple smtp goes, what im looking for is information on how to code the SMTP-AUTH commands.

client: EHLO myHost

server: Pleased to meet you
server: 250-ETRN
server: 250-STARTTLS
server: 250-HELP
server: 250-EXPN
server: 250-PIPELINING
server: 250-8BITMIME
server: 250-DSN
server: 250-AUTH LOGIN
server: 250-AUTH=LOGIN
server: 250 SIZE 10485760

client: auth login

server: 334 VXNlcm5hbWU6  <-- some kind of base64 challenge

and thats as far as i get, as im not sure what to do next to authorise/what kind of response to send. all ideas appreciated!
Interesting reading in some articles I just went through.  Anyways, here's what I can gather from ......

What you are supposed to send next is the base64 encoded username.  Then after it's response (in base64), the encoded password.  This site includes links to base64 coders and decoders as well as some other useful info.  I think this may get you on your way.

Let me know if this helps.

Dan Soto
New Orleans, LA

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SEND   username
SEND   password
<You are now authenticated>
SEND   MAIL FROM etc...etc..

The trick is - the Username AND the Password need to be Base64 encoded...

I found code to do the Base64 at

Hope this helps...

grimkinAuthor Commented:
hi guys,

both of these comments helped and both gave links to really good resources ...

errr how do i accept both answers ?!?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Protocols

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.