You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well i had studied javamail and trying in android but while i am running the
code i m getting error ...
05-06 10:07:45.160: ERROR/Mail app(602):
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS
command first. q5sm1883105pbp.65
05-06 10:07:45.160: ERROR/Mail app(602): at
com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1515)
05-06 10:07:45.160: ERROR/Mail app(602): at
com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1054)
05-06 10:07:45.160: ERROR/Mail app(602): at
com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:634)
05-06 10:07:45.160: ERROR/Mail app(602): at
javax.mail.Transport.send0(Transport.java:189)
05-06 10:07:45.160: ERROR/Mail app(602): at
javax.mail.Transport.send(Transport.java:118)
05-06 10:07:45.160: ERROR/Mail app(602): at
com.livesoft.user.mail.Main$1.onClick(Main.java:49)
05-06 10:07:45.160: ERROR/Mail app(602): at
android.view.View.performClick(View.java:2408)
05-06 10:07:45.160: ERROR/Mail app(602): at
android.view.View$PerformClick.run(View.java:8816)
05-06 10:07:45.160: ERROR/Mail app(602): at
android.os.Handler.handleCallback(Handler.java:587)
05-06 10:07:45.160: ERROR/Mail app(602): at
android.os.Handler.dispatchMessage(Handler.java:92)
05-06 10:07:45.160: ERROR/Mail app(602): at
android.os.Looper.loop(Looper.java:123)
05-06 10:07:45.160: ERROR/Mail app(602): at
android.app.ActivityThread.main(ActivityThread.java:4627)
05-06 10:07:45.160: ERROR/Mail app(602): at
java.lang.reflect.Method.invokeNative(Native Method)
05-06 10:07:45.160: ERROR/Mail app(602): at
java.lang.reflect.Method.invoke(Method.java:521)
05-06 10:07:45.160: ERROR/Mail app(602): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-06 10:07:45.160: ERROR/Mail app(602): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-06 10:07:45.160: ERROR/Mail app(602): at
dalvik.system.NativeStart.main(Native Method)
here is my code :
addImage.setOnClickListener(new OnClickListener(){
public void onClick(View arg0) {
// TODO Auto-generated method stub
String host= "smtp.gmail.com";
String to="[email protected]";
String from = "[email protected]";
Properties props= new Properties();
props.setProperty("mail.smtp.host", host);
Session session = Session.getDefaultInstance(props);
try{
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
msg.setSubject("Hi..");
msg.setText("Test mail");
Transport.send(msg);
Toast.makeText(Main.this, "Email send succesfully", Toast.LENGTH_LONG).show();
}
catch(Exception e){
Log.e("Mail app","there is problem in sending mail",e);
}
}
});
please help me
Original issue reported on code.google.com by [email protected] on 6 May 2011 at 4:42
The text was updated successfully, but these errors were encountered:
You are missing some important properties for it to work, such as the SMTP
port, authentication settings, etc, and it also lacks the authenticator for
sending mail...
The remaining code seems to be alright.
Give a look here for a working example with Gmail:
http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javama
il-api-without-using-the-default-android-app/2033124#2033124
Original issue reported on code.google.com by
[email protected]
on 6 May 2011 at 4:42The text was updated successfully, but these errors were encountered: