Powered by Blogger.

Saturday 10 December 2022

How to Implement SMTP (Simple Mail Transfer Protocol: To, Cc and Bcc Mails) Using Java

1 comment :
In this post we will learn how To, Cc and Bcc mails are sent and also how the file is attached to the mail. Some jar files are available in java for the development of mails, which is javax.mail jar file, as well as a jar named SendMailA143mk, download both the jar file and the names of the jar SendMailA143mk in which two methods / functions have been used, the names of the methods are as follows:    
1. SendMaleWPathFile();
2. SendMaleWBody();
There are some parameters in both the methods, which we initialize by creating and object like this.

String noReplayEmailID="noreplyMail@mailDomen.com";
String noReplayEmailPass="mailPassword"; 
String host="smtp.office365.com"; 
String port="587";
String sentTomail="toMail@mailDomen.com"; 
String sentToCCmail="ccMail@mailDomen.com"; 
String sentToBCCmail="bccMail@mailDomen.com"; 
String Subject="SMTP Implementation Using Java"; 
String bodyText=" Hi A143mk blogs Test Mail. Thanks. "; 
String PathFile="D:\\logo.png"; 
Create this Main Method, you can use this code in functions/methods as per you wish.
 

Output is:

















Important Information: We develop/implement this type of web application or other user application in online platform like How to send To, Cc and Bcc mails to online user providing security and also we are able to send email to user through OTP in this development Whether or not your personal information such as password/email OTP is neither in the database of the online platform nor in the possession of anyone else. By this we identify the authenticity of the user.

Sunday 17 December 2017

Multiple File convert to 7Zip File and attachments Through the Email !

No comments :
The Send Email Application has been created Using java with jdbc:oracle DataBase,with Multiple File convert to 7Zip File and attachments Through the Email .
Project  Folder and Jar File Position: 



Properties File: "dataBase.properties" is file Name
#Data Base Connection Name.
DATABASE_URL = jdbc:oracle:thin:@Host Name:Port Number:SID
DATABASE_USER = User Name
DATABASE_PASSWORD = Password
# Table Details information. 
TABLE_NAME = xyz
TABLE_FILE_NAME = xyz.FileColummn_Name
TABLE_TO_EMAIL = xyz.FileColummn_EmailId
# No Repaly email information. 
EMAIL_USER_NAME= xzy@gmail.com
EMAIL_USER_PASSWORD= xyzPassword
EMAIL_HOST = smtp.gmail.com
EMAIL_PORT = 587
EMAIL_SUBJECT= Write to Email Subjects
EMAIL_TEXTBODY= Write to Email Body
ATTACHED_FILE_URL= D://fileNameDR//
ATTACHED_FILE7ZIP_URL=D://7ZipTO_Mail//


Application Code:
1. Zip7AutoTOEmail.java

2. ZipCompress.java

3. SendMail.java