send email through j2me application

前端 未结 2 703
滥情空心
滥情空心 2021-01-29 05:54

I am having an application build using j2me lwuit. I need to send e-mail from that app.

2条回答
  •  鱼传尺愫
    2021-01-29 06:38

    To make your application smaller, I'd suggest to implement SMPT over a SocketConnection. For small e-mails this shall be pretty straightforward:

    SocketConnection connection = (SocketConnection)Connector.open("socket://your.smtp.server:25");
    DataInputStream is  = sc.openDataInputStream();
    DataOutputStream os = sc.openDataOutputStream();
    //now the SMTP chat with server
    

    Using this approach may allow you to make your application to be depend only on MIDP/CLDC profiles, thus to be easier portable to other phones (at least in theory).

提交回复
热议问题