Avatar of hipal
hipalFlag for United States of America

asked on 

Sending an email on pressing a JButton

Hi,

I was wondering if this is really easy to do.
On clicking a JButton, I want a blank email to be sent to a predefined email add.
Can some please give the code snippet to be inserted in actionlistener to achieve this.

Actually I even want a textarea to write mail and email id, but if some one can just tell the easier version that is jst sending a mail .. I can take from there.

Thanks a lot !
JavaEmail ClientsProgramming

Avatar of undefined
Last Comment
CEHJ
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

:)
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Avatar of hipal
hipal
Flag of United States of America image

ASKER

I am not sure about mail servers and stuff.

I do not know which one (or if one) I should use. All I want to do is to send a mail on pressing a JButton.

Please suggest which is the best and easy out ?
Avatar of Mick Barry
Mick Barry
Flag of Australia image

more than likely the comment you accepted will not work (not sure why you accepted it), try the code I posted
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You just need a Google account to use the code i linked to
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo