Friday 15 March 2013

ssl - android : mail send using javamail smtp tls is not getting saved in sent folder of icloud account -



ssl - android : mail send using javamail smtp tls is not getting saved in sent folder of icloud account -

i using javamail mail service client application. have added icloud business relationship smtp tls outgoing, , imap incoming

acct.iincominghosttype = constants.hosttype_imap; acct.sincominghost = "imap.mail.me.com"; acct.sincominghostport = "993"; acct.iincominghostencryption = constants.encrypt_ssl; acct.soutgoinghost = "smtp.mail.me.com"; acct.soutgoinghostport = "587"; acct.ioutgoinghostencryption = constants.encrypt_tls; acct.boutgoinghostspalogin = false;

now when send mail, it's reaching recipient mailbox - gmail or outlook etc, mail service sent not coming in sent folder of icloud account.

code looks below

properties props = new properties(); /// sprotocol "smtp" props.setproperty("mail.debug", "true"); props.setproperty("mail.transport.protocol", sprotocol); props.setproperty("mail.host", acct.soutgoinghost); props.setproperty("mail." + sprotocol + ".port", acct.soutgoinghostport); props.setproperty("mail." + sprotocol + ".socketfactory.port", acct.soutgoinghostport); props.setproperty("mail." + sprotocol + ".timeout", "30000"); props.setproperty("mail." + sprotocol + ".connectiontimeout", "30000"); props.setproperty("mail." + sprotocol + ".auth", "true"); props.setproperty("mail.debug.auth", "true"); props.setproperty("mail." + sprotocol + ".sasl.enable", "true"); props.setproperty("mail." + sprotocol + ".starttls.enable", "true"); props.setproperty("mail." + sprotocol + ".ssl.trust", "*"); props.setproperty("mail." + sprotocol + ".ssl.socketfactory.class", "com.isaacdanielgroup.sempostmark.sempsslsocketfactory"); props.setproperty("mail." + sprotocol + ".ssl.socketfactory.fallback", "false");

first, might able simplify programme getting rid of socket mill stuff.

there's no magic causes sent messages added sent folder. if want re-create of message there, need set there yourself. see msgsend.java sample program example.

android ssl smtp javamail

No comments:

Post a Comment