Send email using java code tutorial

  Рет қаралды 34,468

Code Tech Gyan

Code Tech Gyan

Күн бұрын

Пікірлер: 64
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
Code available at this page - wp.me/pdJoZn-4u
@atuldarne3239
@atuldarne3239 3 ай бұрын
i want to restrict the email for print, fwd, reply how can be this done ? is there any specific header that we need to set
@AkankshaThokade
@AkankshaThokade 3 жыл бұрын
This code has saved my life with a course project a day before the review 😭😭😭 Thank you soooo mucchhhh!!!! You're an amazing human being!!!
@CodeTechGyan
@CodeTechGyan 3 жыл бұрын
Please subscribe to my channel and share with your friends
@jamesdawson4783
@jamesdawson4783 2 жыл бұрын
Had to change the smtp port from 547 to 587 to work. Other than that everything is good, thank you.
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
Glad that it helped !!
@edwinmanalaotao2019
@edwinmanalaotao2019 2 жыл бұрын
Thank you bro! ez fix
@yeshuverma3102
@yeshuverma3102 3 жыл бұрын
best video on this topic but I really want to suggest to explain slowly as you are very fast
@CodeTechGyan
@CodeTechGyan 3 жыл бұрын
Thank you .. I will keep that in mind while explaining next topic 😊
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
Please subscribe our channel ☺️
@dev100treta
@dev100treta 3 жыл бұрын
I have the following error: Error occurred during initialization of boot layer java.lang.module.ResolutionException: Modules activation and java.activation export package javax.activation to module org.jetbrains.annotations Even though I have the following dependencies: com.sun.activation javax.activation 1.2.0 javax.activation javax.activation-api 1.2.0
@DeepakMaurya-bb3wf
@DeepakMaurya-bb3wf 4 жыл бұрын
hey i like your video. this code run can run local machine very well but if your server ip is different then you stuck even you can make security low still it wont work. can you come up solution of that. also please when u doing please check another case after 10 min are you still able to send mail. thanks..
@CodeTechGyan
@CodeTechGyan 4 жыл бұрын
Thanks for liking the video . I am able to send emails at anytime using this code..never found any issues with that . Also, if you make changes in gmail security and allow it to get accessed by low security apps and remove 2-way authentication.. it should work
@DeepakMaurya-bb3wf
@DeepakMaurya-bb3wf 4 жыл бұрын
@@CodeTechGyan ok can you please make another video to host this app in vps/server(linux) and send mail back to you. and during that please show IP address of yours and server IP. Hope it will clear doubts.
@CodeTechGyan
@CodeTechGyan 4 жыл бұрын
Sure , I will check on that
@anonofDeath
@anonofDeath 3 жыл бұрын
I figured out that throwing the exceptions is one of the problems I'm having and it says it can't initialize the main class. Do you have any suggestions?
@thoraxlaneus9961
@thoraxlaneus9961 3 жыл бұрын
use it in the main method and use try and catch
@kristjantoplana2993
@kristjantoplana2993 10 ай бұрын
Very good and helpful, but the email body is sent as an attachment. Anyone know how to resolve this?
@netuser2513
@netuser2513 8 ай бұрын
You can change the body part with this code : MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setText(emailBody, "UTF-8","plain"); I hope this works for you 😉
@040aniruddhagunjal6
@040aniruddhagunjal6 Жыл бұрын
Its Showing .. : Could not connect to smtp host : email host value , port number
@CodeTechGyan
@CodeTechGyan Жыл бұрын
Pls try with different port number and make sure you have entered correct host name .
@CodeTechGyan
@CodeTechGyan 4 жыл бұрын
Learn how to send an attachment with slight modification kzbin.info/www/bejne/aXy7n3VopNanZ80
@fulari3172
@fulari3172 3 жыл бұрын
No need of another video. Because attachment code is an single line code MimeBodyPart attachment= new MimeBodyPart(); attachment. attachFile("your file name"); Okk
@giantgamingt9002
@giantgamingt9002 Жыл бұрын
I am getting exception that username and pasword not accepted. What should i do?
@omegamedia3508
@omegamedia3508 11 ай бұрын
Did u fix it?
@ayushpandey7
@ayushpandey7 4 жыл бұрын
I have one doubt here and in general too, How you create an instance of an object without using the keyword “new” for example Transport object here? Without the “new” keyword, Java cannot make a new instance of the object in heap memory, right!
@CodeTechGyan
@CodeTechGyan 4 жыл бұрын
You can get an object from connection factory. In this example newSession is a connection factory and getTransport() is used to fetch a transport object from that.
@ColinK3310
@ColinK3310 3 жыл бұрын
Great video! But I get the issue that it sends a document ""noname" and no body text when running your exact code. How can I fix this?
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
Looks like email subject and body is not being added properly to the multipart object.can you compare your code to the git code I provided. Check video description for git link.
@mecoboehme1974
@mecoboehme1974 Жыл бұрын
I have a work similar to your video can you help me take a look at it?
@atishkumarsahu6095
@atishkumarsahu6095 2 жыл бұрын
My InternetAddress showing error please help me to and give me a solution please. 😕😕😕😕😕
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
What is the error ?
@felixkarma4983
@felixkarma4983 3 жыл бұрын
Thank you so very much !!! My brain would be explode XD
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
All the best 😊
@Sinbad1999
@Sinbad1999 3 жыл бұрын
How do i set up the jar files?
@CodeTechGyan
@CodeTechGyan 3 жыл бұрын
Pls check if this helps .. I have explained how to use java jars here and jars for mailing service has been explained in this video itself. kzbin.info/www/bejne/r4DZdaWkaL9nbpY
@trankhaiminhkhoitran7928
@trankhaiminhkhoitran7928 3 жыл бұрын
Can you post the whole code on like git
@CodeTechGyan
@CodeTechGyan 3 жыл бұрын
Sure .. I will do that and share the link 👍🏻
@CodeTechGyan
@CodeTechGyan 3 жыл бұрын
here is the code repository github.com/GitAccSK/code-tech-gyan/blob/main/Send%20email%20using%20java
@rahulmistry5381
@rahulmistry5381 Жыл бұрын
What does those jar files do ?
@Mr.noname_
@Mr.noname_ 4 ай бұрын
none of your business
@rahulmistry5381
@rahulmistry5381 4 ай бұрын
@@Mr.noname_ You dumb, do you even understand what I asked, that you are commenting "none of your business" ?
@rahulmistry5381
@rahulmistry5381 4 ай бұрын
Can't you see what I've commented that you've commented "none of your business" ?
@rahulmistry5381
@rahulmistry5381 4 ай бұрын
Also, why you deleted my comment ?
@joaquingutierrez5435
@joaquingutierrez5435 3 жыл бұрын
how can i add signature and closing to mail?
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
You need to add signature in the multipart .
@prashanthabhat5497
@prashanthabhat5497 3 жыл бұрын
Hi...how to send bulk emails ?
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
If you want to send email to multiple recipient .. just add them in the recipient array separated by comma.
@ashleshapawar444
@ashleshapawar444 2 жыл бұрын
is it maven based
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
No
@ashleshapawar444
@ashleshapawar444 2 жыл бұрын
@@CodeTechGyan got error in importing email. session
@velmuruganr9321
@velmuruganr9321 3 жыл бұрын
thanks a lot... long live sister..lol
@hindavilande1636
@hindavilande1636 2 жыл бұрын
thank you so much..
@CodeTechGyan
@CodeTechGyan 2 жыл бұрын
You are welcome
@CrazyAshu34
@CrazyAshu34 3 жыл бұрын
why don't You show The emails Don't watch this Videos 😕 waist of ⌚ U know what wanna Say😳
@CodeTechGyan
@CodeTechGyan 3 жыл бұрын
I have shown emails at the end of this video with hidden mailing ids. While you are executing this code you can use email Id of your choice and get the mails. Hope this helps . Thanks !!
@Alexander-dj1jp
@Alexander-dj1jp 3 жыл бұрын
Hello, my body in the email is displayed as: "noname" and there's not the text which I have put in the emailbody, pls help
@Alexander-dj1jp
@Alexander-dj1jp 3 жыл бұрын
I actually fixed it myself: "i put this in bodyPart.setContent(emailBody, "text/html;charset=UTF-8);
@CodeTechGyan
@CodeTechGyan 3 жыл бұрын
You can check code on git repository mentioned in this video detail section. Hope you were able to send email successfully via this code 👍🏻
@erzafixed5372
@erzafixed5372 2 жыл бұрын
@@Alexander-dj1jp thank uu
@ekramulhaque988
@ekramulhaque988 Жыл бұрын
is it working?
Send email with attachment using java tutorial
4:20
Code Tech Gyan
Рет қаралды 1,6 М.
Java Spring Boot Email Sender Service Tutorial
23:04
Ivan Jakimovski
Рет қаралды 24 М.
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 31 МЛН
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 35 МЛН
Java - How to Send an Email with Attachments
17:53
WittCode
Рет қаралды 14 М.
Java - Send Email from Java Program - Java Mail API
14:10
Genuine Coder
Рет қаралды 161 М.
Send Email Using Spring Boot | Gmail SMTP | Java Mail Sender
7:44
Code With Arjun
Рет қаралды 164 М.
Sending Email Using the Gmail API And Java
27:27
Sebastian Daschner
Рет қаралды 48 М.
Java snake game 🐍
43:30
Bro Code
Рет қаралды 1,5 МЛН
I learned to code from scratch in 1 year. Here's how.
41:55
Thomas Frank
Рет қаралды 418 М.