How to establish an automated email service for a website? - java

I seem to fail at googling this specific thing: Like almost every website I too want to provide an automated email service for stuff like "password reset" or "validate email" after user registration.
However, I have not really an idea how I would do that and/or where to start. There must be some fast, easy and cheap solutions out there since this is quite a common issue for websites and I do not intend to re-invent the wheel for this problem.
So: What do I have to do to get such an automated email service for my website that works with my domain of course and where can I get started?
I am aware that I can use e.g. JavaMail to send emails as I like but do I still have to do everything by hand here or can I use an existing service?

On my site, I custom built it. You send the email out with the "guid" for password resets and validate emails and then you handle that on your website when they click the links. I think doing it yourself will be just as easy as trying to use a third party imo. Setting up a mail server isn't that hard, it might seem daunting at first, but theirs plenty of good ones available without charge. Configuring it to send mail properly, takes a little work (A lot of it is configured out of the box), but an excellent resource you can use is Unlock The Inbox. Just go through the free resources on the left about all the different things to be aware of. Then you can hook in 3rd party email marketing campaign managers without cost as well like phplist. It will give you more flexibility over time.

Related

Best way to receive images uploaded by a user on Android app?

I'm working on an app that lets users submit orders, and also make custom orders where they upload an image. I then want to receive all this information by email. Initially, I was using JavaMail API with Gmail, but I heard that it can cause a blocking of the account due to "Suspicious Activity". Apparently a way around this is to use the Amazon SES SMTP server, but with that I cannot seem to find any documentation whatsoever on sending emails with attachments for Android (there is one but it's for general Java and it does not work on Android).
There must be a better way to to do this, I'm just not sure where to start looking. This is my first dev project (I'm in my 2nd year of computer science), so I'm pretty green with this stuff. If someone could point me in the right direction I would be so grateful. I'm open to learning new things, I'm just not even sure about what I need to learn in the first place for this.
your email will be blocked if you are sending emails in huge amount like hundreds of email in a second if you are not sending email in such amount so don't worry about getting blocked and if you are sending in email in such amount then you can take external email service theirs a lot of marketing via email services i hope this might help

I need my app (Java, SpringBoot) to be able to send company Exchange e-mails. But there's a catch (difficult to configure)

Long story short, I'm an intern in an IT company. I have a specific task assigned to me, basically it's a simple REST-based application that receives JSON's, processes them and stores them in the database.
I was assigned a new task, to add a functionality to send those processed JSONs in an e-mail.
Simple, right? I took a glance at Spring-Mail documentation, looked at some tutorials, and 40 minutes later my application was sending beautiful e-mails through throwaway gmail account.
But it turns out, that I actually have to use the company's Exchange service.
Thankfully there's an EWS API that provides all the necessary functionalities for that... right? Well, there's a catch. SMTP in the company is completely disabled, and I have a hard time configuring the application.
When I tried configuring the application like it's suggested through EWS wiki I did encounter some problems.
ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("emailAddress", "password");
service.setCredentials(credentials);
That's pretty self explainatory.
However, the hard part begins here:
service.autodiscoverUrl("<your_email_address>");
This just doesn't work, even with the overloaded constructor (that includes RedirectionUrlCallback) which is recommended. I've tried multiple combinations, but nothing works.
You can also enter this address manually, but where do I get it from?
In my company Outlook I've found some links, that could be fitting, like:
https://autodiscover.COMPANY.com/EWS/Exchange.asmx
It however just doesn't work. When i enter this link in my browser is says that a service was created, another link that ends with /EWS/Services.wsdl is created, and it says that I should process it with SvcUtil.exe - honestly I have no idea what does it even mean, it's my first time I'm using the exchange and mailing APIs.
Where do I even go from here, do you have any tips? Should I try spring integration? What am I doing wrong? I'm feeling pretty down after wasting 7 hours on just trying to connect to the freaking mailbox, any help will be appreciated.
Not sure if it's relevant, but the Exchange version is 2016 CU4.

Encrypting/hiding portions of the source code

I've made a simple mailing app that takes in email credentials and uses it to send emails of certain kinds to selected addresses. Problem is, I've had to input the credentials right into the code, so anyone who uses dex2jar can get the source code and get the email used for forwarding and easily make the app obsolete.
I imagine I'm not the only one facing this issue, so what are some ways to make my code secure?
No matter how good of a technique you use to hide the credentials, if it's in the code then it can always be found.
Instead of hard coding them in, you could perhaps let the user specify them when he starts the app? If that can't be avoided you could instead have a remote service that will do the sending and forward your request to that.
You can not both connect to an e-mail account and keep those same users out of said e-mail account. Consider using a hosted server as part of the project to securely connect to the e-mail account from the server level and process these e-mails remotely.

Allow Email Interaction - Java Server

First of all, this is a kinda broad question, and I believe it belongs partially on Serverfault also, so bear with me. I tried googling and searching here, but only found parts of this question but not the whole idea of it. Here goes:
My problem is:
Im writing a web application, and my server is Java. I want to add a feature where my users can do BY EMAIL some of the possible interactions they can already do on the interface. For this part I believe to setup a mail server (any server recommendations?), and from my Java app (Tomcat) connect to the mail server and read the emails via POP3 or something (any API recommendations?).
The tricky part is that I dont want to use a single email address for that purpose. I want, for example, that if my user Joe want to CREATE an object in my application, then he would send an email to joe#create.mydomain.com, if he would like to DELETE an object, he would send to joe#delete.mydomain.com. The possible actions are previously known and limited, of course (since I would have to mess with the DNS for that purpose). This is just an example, most likely I would have to "tokenize" the left part of the email address (before the #), or else any user would be able to create and delete other userĀ“s objects (since email is semi-anonymous).
And the extra-tricky part is that I already have an email server running on mydomain.com, for the corporate emails. How to make that all emails from the actions words ("subdomains"?) go to my "application email server" and those without action words go to my "corporate email server"?
I guess thats it!
Thanks all
Since you're already using Java, it sounds like Apache James might be a good fit for you.
It allows you to create Matchers and Mailets which pick out and process emails based on your defined criteria (which could be address based sender/receiver matching, subject lines, etc). The process could insert records into a database, invoke a web service, anything you want to write in Java.

Integrate IM/chatting functionality in my Java application

I am interested in putting a chatting functionality as part of an application.
What I am interested in:
I would like to keep my application instances acting as peers, i.e.
I would prefer not to write also some server module to handle
message communications
I would like it to be able to use it with exising IM accounts. E.g.
someone can use it using his MSN account or any other client
account he may have, same way he would use MSN Messenger or Tor client etc
I googled and found that there are some Java MSN libraries available and also some other libraries that support IM e.g. SMACK for JABBER etc (not sure what that is) but I am not sure if the latter could be used for option 2 I mention.
My preference on 2 is because I assume that this way a user could do chat no matter where he is while in other solution I assume that some network infrastructure e.g. with routable IPs etc would be required. Am I wrong here?
Does anyone have expererience with Java IM libraries? Are for example any issues e.g. with different MSN versions or something?(Don't know if the protocol has been changing often to matter for me).
What would be the best path/option for my requirements?
I would go with a Jabber based approach. Jabber (also called XMPP) is an open protocol with lots of implementations and supports connecting to other IM services via transports. That way you would not have to deal with changes to the Windows Live protocols. You can rely on the open source community to provide that functionality for you.
Edit: It seems, that Windows Live even allows native XMPP access.
If you like, you can always set up your own Jabber server to provide a tighter integration with existing user accounts. In that case you wouldn't need to write the whole server.

Categories