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]

Related Posts

2 Responses to “airxmail: How to use STARTTLS extension to SMTP”

  • Rao より:

    My code completes successfully but I don’t receive email. None of the event listeners are triggered. I am not sure what causes the startTlsHandler to be invoked. Please post the entire code if it is ok with you.
    Thanks

  • coltware より:

    Thank you for your comment.

    >Please post the entire code if it is ok with you.

    Please wait a few days.
    I will post more details.

    If you can show me the your code, that help me to write more information.
    If it is ok, please send it to my e-mail.
    ( My e-mail address is on blog’s footer )

Leave a Reply

Spam protection by WP Captcha-Free

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