Archive for 12月, 2010

The STARTTLS extension is complex for a moment.
A smtp client have to connect the server with plain socket.
After the client gives STARTTLS command , the client have to change to tls socket from plain socket.

The following code is a sample to use STARTTLS command


// comment out because of using plain socket
//sender.setParameter(SMTPSender.SOCKET_OBJECT,new TLSSocket());

sender.addEventListener(SMTPEvent.SMTP_START_TLS,startTlsHandler);

// chage to TLSSocket
public function startTlsHandler(event:SMTPEvent):void{
var sock:Object = event.socket as Socket;
var tls:TLSSocket = new TLSSocket();
sender.setParameter(SMTPSender.SOCKET_OBJECT,tls);

tls.startTLS(sock,”your.host.name”); // <– please set “your.host.name” as you like } [/as3]

RSS
Add to Google
2010年12月
« 11月   1月 »
 1234
567891011
12131415161718
19202122232425
262728293031