質問

I have an app which send mail to my defined mail address "myemail@own.com". For this i create my own Custom Email View Which contains check boxes message body and other options. Now i want that when send button is pressed my app should not go to gmail view or other email client view it directly submit the data

String recepientEmail = "myemail@own.comm";

// either set to destination email or leave empty

    Intent intent = new Intent(Intent.ACTION_SENDTO);

    intent.setData(Uri.parse("mailto:" + recepientEmail));

    startActivity(intent);

but on submit it opens gmail or chooser email client view but i dont want to show gmail view

役に立ちましたか?

解決

i add only explanation for modification required for any email server to this link : Click Here

1st change :

private String mailhost = "smtp.gmail.com

change to

private String mailhost = "your smtp email server address";

2nd change :

props.put("mail.smtp.port", "465");   
props.put("mail.smtp.socketFactory.port", "465"); 

change to

props.put("mail.smtp.port", your smtp port);   
props.put("mail.smtp.socketFactory.port", your smtp port); 

3rd change :

default properties are

props.setProperty("mail.transport.protocol", "smtp");   
props.setProperty("mail.host", mailhost); 

add more properties if your email server is required.

i hope this will help you.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top