Mesaje recente

Members
Stats
  • Total Posts: 17,786
  • Total Topics: 1,234
  • Online today: 178
  • Online ever: 340
  • (Yesterday at 00:10)
Users Online
Users: 0
Guests: 110
Total: 110

smtp java

Started by kquizak, 02 March 2007, 23:07

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

kquizak

cred ca fac monopol cu intrebari la 'programare'  :">

folosesc cam doua algoritmuri pt smtp(cel de la sun si unul 'facut') si niciunul nu merge.
1)primul...

                                               SmtpClient smtpClient=new SmtpClient(mail_server_setting);
smtpClient.from(mail_address_setting);
smtpClient.to(jTextFieldTo.toString());
PrintStream msg=smtpClient.startMessage();
msg.println("To:"+jTextFieldTo.toString());
msg.println("Subject:test smtp client");
msg.println("fgdgfd");
smtpClient.closeServer();

rezultat...nici o eroare,imi verific mailul si nimic(mentionez ca eu imi trimit mie)

2)al doilea...

os.writeBytes("HELO\r\n");   
                os.writeBytes("MAIL From:"+main.mail_username_setting.toString()+"\r\n");
                os.writeBytes("RCPT To:"+main.jTextFieldTo.toString()+"\r\n");
                os.writeBytes("DATA\r\n");
                os.writeBytes("From:"+main.mail_address_setting+"\r\n");
                os.writeBytes("Subject: testing-jScan4Mail smtp client\r\n");
                os.writeBytes("\r\n.\r\n");
                os.writeBytes("QUIT");

de remarcat ca e \r\n--doar cu \n nu accepta serverul
si serverul raspunde asa la cererile mele:

Server: 220 smtp2.rdslink.ro ESMTP
Server: 250 smtp2.rdslink.ro
Server: 250 ok
Server: 250 ok
Server: 354 go ahead
Server: 250 ok 1172868594 qp 25822

dar.....uimitor daca verific mailul...nimic

3)am incercat si telnet

220 smtp2.rdslink.ro ESMTP
helo
250 smtp2.rdslink.ro
mail from:popica06
250 ok
RCPT To:popica06@rdslink.ro
250 ok
data
354 go ahead
From:popica06@rdslink.ro
To:popica06@rdslink.ro
Subject:telnet

.
250 ok 1172869673 qp 6002
quit
221 smtp2.rdslink.ro


Connection to host lost.

si am avut succes...dar pe jumate ca uneori primesc la helo 'not implemented'

sunt eu chior? sunt aceleasi raspunsuri(aprox) de la server bag seama (2 si 3)

ar mai fi ceva...autentificarea cum se face...clientul de mail cere...dar in sesiunea telnet nu...
network-tools.ath.cx ---nmap yourself