0

I'm trying to have an app with dialogue boxes with contact information and delivery info be sent to one email when the submit button is hit. I'm just not sure how to go about it, I don't need code per-say. Just a way to go about it, but if you already have an example made though that'd be helpful also.

2 Answers2

0

This looks like a duplicate question. You should be able to find what you need here: How can I send emails from my Android application?

Edit:

After having clarified the issue. The following link describes how to send an email to an SMTP server from a fixed address, which should allow the sending of details from the app to an email account.

How do I send an SMTP Message from Java?

Community
  • 1
  • 1
Lex Webb
  • 2,772
  • 2
  • 21
  • 36
  • Well, I don't want it sent from their email. – Brendan Ocheltree Sep 09 '15 at 11:27
  • My apologies i misunderstood what you meant. So you want to send the information from one of your emails to an email specified in the contact information? – Lex Webb Sep 09 '15 at 11:29
  • Well not really, they put in information like their phone number and name and kind of like an automated message is sent to one email address in our system. Sorry for being unclear on that, I was thinking of doing an online PHP script that takes variables from the app and sends an email to the email in the system. – Brendan Ocheltree Sep 09 '15 at 11:36
  • Emails can only be sent from an email server from a specified email address. In order to do this programatically, the application doing the email sending needs to have some way of communicating with the email server. In your case you would probably need a server hosted with your existing systems that the android app can communicate with through a Web API for example. – Lex Webb Sep 09 '15 at 11:39
  • That was what I'm probably going to do, can I use an existing Free SMTP service like AOLs or Yahoos? – Brendan Ocheltree Sep 09 '15 at 11:43
  • Yes you probably can. I have found a question which explains the process of sending an email through SMTP. It looks like it used a hard coded account to do it which sounds like what you need to do. You can probably use an AOL or Yahoo email address for this. http://stackoverflow.com/questions/73580/how-do-i-send-an-smtp-message-from-java – Lex Webb Sep 09 '15 at 11:46
  • Great, i've updated my answer with the correct link :) – Lex Webb Sep 09 '15 at 15:03
0
private void SendErrorMail( Context _context, String ErrorContent )
{
Intent sendIntent = new Intent(Intent.ACTION_SEND);
String subject = _context.getResources().getString( R.string.CrashReport_MailSubject );
String body = _context.getResources().getString( R.string.CrashReport_MailBody ) +
"\n\n"+
ErrorContent+
"\n\n";
sendIntent.putExtra(Intent.EXTRA_EMAIL, getEmailAddressees());
sendIntent.putExtra(Intent.EXTRA_TEXT, body);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
sendIntent.setType("message/rfc822");
_context.startActivity( Intent.createChooser(sendIntent, "Title:") );
}
Nooruddin Lakhani
  • 7,507
  • 2
  • 19
  • 39