5

I am creating a feedback form in my app.

This is what I want :

When the user fills the feedback form and then clicks on Submit button, the user information is then sent to my email address without asking the user to log into his/her account i.e. user can send feedback without our email credentials. Is it possible?

If yes then please give some hint.

Grhm
  • 6,726
  • 4
  • 40
  • 64
AmmY
  • 1,821
  • 1
  • 20
  • 31

3 Answers3

1

I hit a similar problem and ended up sending emails to myself using AWS SES

public static void sendEmail(String receiver,String title,String message){
    AWSCredentials credentials = getCreds();
    AmazonSimpleEmailServiceClient sesClient = new AmazonSimpleEmailServiceClient( credentials );

    Content subjectContent = new Content(title);
    Body messageBody = new Body(new Content(message));
    Message feedbackMessage = new Message(subjectContent,messageBody);
    Destination destination = new Destination().withToAddresses(receiver);

    SendEmailRequest request = new SendEmailRequest(receiver,destination,feedbackMessage);
    SendEmailResult result =  sesClient.sendEmail(request);
}
Colin
  • 588
  • 6
  • 9
0

Check the answer below for sending SMTP messages (e-mails) in Java. You can set credentials for a sender account inside code here, so you won't need credentials from the user.

https://stackoverflow.com/a/73649/2086735

Community
  • 1
  • 1
Guven Salgun
  • 101
  • 5
  • my application creshed when I click on Send Email Button from 2nd link. log error is- java.lang.NoClassDefFoundError: javax.activation.DataHandler. – Aman yesterday I setup the email config via gmail Smtp. but my msg.setFrom(new InternetAddress("xyz@abc.com")) not working. When I receve a mail then it show the user name in From section. – AmmY May 23 '13 at 04:45
0

There are a number of options out there, so really you can take your pick. If I had to recommend one, though, I would have to give my (admittedly biased) recommendation for Appygram.

The main reason I recommend it in your case is it allows for separation of concerns between your e-mail address and your app. So, in the code for your app, you essentially embed an API key. Then, in the Appygram web console, you enter information for the recipient(s) that should receive the feedback. This way, (a) your app never has to maintain the recipient e-mail address and, more importantly (b) if you ever need to change this e-mail address, you can do so in the web console without making any changes or updates to your app. The setup process is easy, and only requires you submit to the API via form or JSON.

Again, I must disclaim that this is a product I'm affiliated with, but it seems like a great fit for your problem at hand. In general, though, something that takes a similar approach where you can substitute your e-mail address for some representative token is likely a good way to go.

Anyway, hope that helps!

GoGoCarl
  • 2,519
  • 13
  • 16