ÉèΪÊ×Ò³ ¼ÓÈëÊÕ²Ø

TOP

AndroidÖÐʹÓÃJavaMail·¢ËÍEmail´øÈº·¢¼Ó¸½¼þ(¶þ)
2014-11-24 07:40:23 À´Ô´: ×÷Õß: ¡¾´ó ÖРС¡¿ ä¯ÀÀ:1´Î
Tags£ºAndroid ʹÓà JavaMail ·¢ËÍ Email Ⱥ·¢ ¸½¼þ
Text(_body);
_multipart.addBodyPart(messageBodyPart);
// Put parts in message
msg.setContent(_multipart);
// send email
Transport.send(msg);


return true;
} else {
return false;
}
}


public void addAttachment(String filename) throws Exception {
BodyPart messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(filename);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(filename);


_multipart.addBodyPart(messageBodyPart);
}


@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(_user, _pass);
}


private Properties _setProperties() {
Properties props = new Properties();


props.put("mail.smtp.host", _host);


if(_debuggable) {
props.put("mail.debug", "true");
}


if(_auth) {
props.put("mail.smtp.auth", "true");
}


props.put("mail.smtp.port", _port);
props.put("mail.smtp.socketFactory.port", _sport);
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallback", "false");


return props;
}


// the getters and setters
public String getBody() {
return _body;
}


public void setBody(String _body) {
this._body = _body;
}


// more of the getters and setters ¡­..
}


Ê×Ò³ ÉÏÒ»Ò³ 1 2 ÏÂÒ»Ò³ βҳ 2/2/2
¡¾´ó ÖРС¡¿¡¾´òÓ¡¡¿ ¡¾·±Ìå¡¿¡¾Í¶¸å¡¿¡¾Êղء¿ ¡¾ÍƼö¡¿¡¾¾Ù±¨¡¿¡¾ÆÀÂÛ¡¿ ¡¾¹Ø±Õ¡¿ ¡¾·µ»Ø¶¥²¿¡¿
·ÖÏíµ½: 
ÉÏһƪ£ºÆÊÎöcocos2d-xÖ®ActionʵÏÖ ÏÂһƪ£ºAndroidÖÐÓÃintent·¢ËÍÓʼþ

ÆÀÂÛ

ÕÊ¡¡¡¡ºÅ: ÃÜÂë: (ÐÂÓû§×¢²á)
Ñé Ö¤ Âë:
±í¡¡¡¡Çé:
ÄÚ¡¡¡¡ÈÝ:

¡¤Linuxϵͳ¼ò½é (2025-12-25 21:55:25)
¡¤Linux°²×°MySQL¹ý³Ì (2025-12-25 21:55:22)
¡¤Linuxϵͳ°²×°½Ì³Ì£¨ (2025-12-25 21:55:20)
¡¤HTTP Åc HTTPS µÄ²î„ (2025-12-25 21:19:45)
¡¤ÍøÕ¾°²È«±ØÐ޿ΣºÍ¼ (2025-12-25 21:19:42)