VB Mail question for you SMTP people.

tekno7777
08-21-2004, 06:41 PM
Hey all, I have a question here.


I wanted to practice using the AUTH on mail servers to allow relaying.
I picked my hotmail mail server 'mail.hotmail.com' on port 25 for test purposes. From what i've read on the RFC, reading other posts, and everything else I could dig up, the idea is that you'd type

EHLO <blah>
and following your 220 ok response code, one would type

AUTH LOGIN
and press enter.

At this point, you will receive a base64-encoded message that will prompt you for your username and password.

(334 success code)

I encoded my login name in base64 and sent it, and I receive the same error each time:

501 cannot decode argument.

Unfortunately the RFC does not mention anything other than the fact one needs to simply send the username in base64 and then after a successful reasponse, you would do the same for your password. I cannot seem to make it past the login.

It would seem that perhaps the base64 function is incorrect, so i have supplied some sample code below that is right out of .net manuals

In addition, I have thought perhaps I was typing in the wrong login, and I tried both username as well as username@hotmail.com for login but both to no avail.

Any ideas what the situation could be?


BELOW is the basic code snippet:




Dim s As String
Dim b() As Byte
s = "michaellumpp@hotmail.com"
b = System.Text.UnicodeEncoding.Unicode.GetBytes(s)
s = vbNullString
s = System.Text.UnicodeEncoding.Unicode.GetString(b)

Dim client As New TcpClient("mail.hotmail.com", 25)
Dim ns As NetworkStream = client.GetStream()
Dim stdIn As New StreamReader(ns)
Dim stdOut As New StreamWriter(ns)
Dim responseCode As Int32

lstResults.Items.Add(stdIn.ReadLine()) 'this will show me the response

'EHLO part.
stdOut.WriteLine("EHLO " + Dns.GetHostName())
stdOut.Flush()

stdOut.WriteLine("AUTH LOGIN")
stdOut.Flush()

stdOut.WriteLine(System.Convert.ToBase64String(b))
stdOut.Flush()

lebb
08-23-2004, 09:04 AM
I didn't think hotmail allowed SMTP?

tekno7777
08-23-2004, 11:23 AM
Well, if you just telnet to mail.hotmail.com at port 25, you are allowed to relay using their mail server. I wanted to practice using AUTH to get a feel for how it works. Is it possible hotmail uses more than just a base64 encoding scheme?

If i use verizon's at

outgoing.verizon.net

they do not allow relaying without first logging in. I am going to try them with my username/password and see if things work any differently there. in the mean time, if anyone knows anything further don't hesitate! =p

Thanks!!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum