javascript - Sending an email in phone -
i trying create mobile app in need send email attachment (both single , multiple).
i tried in android want code support both android , ios. tried javascrpit
<!doctype html> <html> <head> <script> function sendmail() { var link = "mailto:me@example.com" + "?cc=myccaddress@example.com" + "&subject=" + escape("this subject") + "&body=" + escape(document.getelementbyid('mytext').value) ; window.location.href = link; } </script> </head> <body> <button onclick="sendmail(); return false">send</button> </body> </html>
but opens outlook 2000 , won't work phone, require opens gmail app in phone sender logged in id , receiver's id added dynamically.
i tried in java not work in client side have send attachment in in future.
suggest work.
thanks.. :)
use java-mail jar (jmapi). create temporary email file (.eml) , add attachment, subject, to, body using mimemessage .eml file , open file using runtime.getruntime.exec(). open default email client sender logged in user.
note: "mailto:" uri not work attachment support attachment has been removed mailto.
Comments
Post a Comment