creating an email account on mail server by mail api - java

I am creating a web application in which i need to create a form by which user can create an email id on mail server. This is like any email service provider do, like gmail(for creating an email account on their site).
I am new to java mail api. Can anyone provide any hint for this.
Any help will be appreciated.
Thanks...
Actually what i want is a sign up form like what gmail or others provides to create an email id account on their servers.
for developing purpose i m using *hmailserve*r.
manually i can create email ids on this server but i want this in programmatic way.

I don't think JavaMail will help here. First, it depends on the mail server you use. Every mail server has different ways to manage user accounts. For example with Postfix you can manage user accounts in a MySQL database (like in that tutorial). Then you just would have to create database entries. Other mail servers may manage the accounts in a textfile.

AFAIK you can't do it using java mail api alone, you'll need and API for the specific mail server you are using.

Java Mail API will help you out in this. Try these links:
http://www.mkyong.com/java/javamail-api-sending-email-via-gmail-smtp-example/
http://javamail.kenai.com/nonav/javadocs/index.html

Related

How to use credentials securely while sending emails with javamail

I need to send emails through my java web app and found this post which does the same. However, it requires to enter the password directly to the source code which I do not want to do.
I also want to commit and push the code on github. I could remove my password from the code before commiting but I would have to do that every time I commit.
I looked into Google Gmail API and OAuth for a secure way but couldn't understand their documentation.
Please suggest any secure way to enter password? or a quickstart to use Gmail API for sending emails through a web app would also be appreciated.

How to create mailer service in Java

I'm working on webApp which one's feature will be to send invitation links to users by emails. I read about JavaMail but when I was testing this solution I noticed that it was working very slow. I was sending emails by my private gmail account and each email before send was authenticated and making this all magic staff which takes a lot of time.
So my questin is - how to do it properly? How to send thic invitation links faster? Maybe I need to buy some external smpt service or something like this? I'm totally newbie in this things so please just show me the way.
Thanks

Can I have a generalized form to acces to any e-mail server using JavaMail?

I' ve seen a lot of examples for accesing to an email account, also downloading attachments, but, most of them works with gmail.
I'm looking for a generalized form to access to most of e-mail providers.
for example
I'm thinking that I can imagine the server, like email#emailserver.com
user = "email#emailserver.com"
password = "hispass"
server = "pop.mailserver.com"
store.connect(server, user, password)
If you want to be able to connect to any server, look at what Thunderbird asks for when configuring a new server. Most of these configuration options will translate in a pretty straightforward way to JavaMail configuration. Thunderbird also includes a bunch of "templates" for popular email service providers, to make setup easier.

How to access the email accounts in third party application in android?

I am creating an application to access a GMail account and some other EMail accounts that are not GMail. How can I access the inboxes of those email accounts my application?
I assume the following:
You want to use Java.
You are trying to retrieve a list of emails.
You need to do this for GMail and non-GMail accounts.
You didn't mention anything about persisting the mails on your device, so I assume you want a quick snapshot of the inbox.
You didn't mention whether you want to leave the emails in the inbox or delete them upon retrieval, so you need a choice concerning that option.
You have no knowledge how fetching EMails works technically.
So first you need to decide on how to access the mails. As you need to access GMail and non-GMail accounts, it seems that accessing the mails via POP3 would be a natural fit. "Usually" this access method will also delete the mails from the users inbox, but there is an option to download mails without deleting them. Authenticating via POP3 is handled in numerous ways, so I would go for a library that does this for you.
I am neither an Android Developer nor do I have much to do with Java outside of JSF, but the Java Mail API seems to be capable of doing POP3 retrieval. And there is an implementation for Android.
Apart from that, your GUI might be missing a possibility to specify a server, a port and an option to pick the relevant encryption. You can of course "guess" these parameters from the given domain of the users email address, but you will need this information to retrieve the emails.
And of course you could also use IMAP, which the Java Mail API also seems to be capable of.

Email Server Functionality with Java Web Application

I have a web application which has several users and each user will have some username which will be unique.
What I want is every registered user get a unique email id like when user xyz registers he gets xyz#domain.com.
This user registers using our web application developed in java, struts2, hibernate etc.
I will need a mail server to do this that I understood, but I do not want to write a mail server application but just talk to that application with some api calls or something.
I am evaluation hmail serve which is java based open source solution, any other solution that will address this particular usecase.
I want my application to act like the front end to this some like any other email service provider.
You can try Mail Enable.
Have a look at Spring's email library: http://static.springsource.org/spring/docs/3.0.x/reference/mail.html

Categories

Resources