sending Email with attachement using Javamail on Eclipse - eclipse

I want to send email with attachement ( a pptx file for example )
I have the path of the file in my database and I want to get it and send an email containing the file (not the path of the file ) .
I have downloaded the java.mail.jar , the activation.jar and also the MySQL-connector-java-bin.jar .
The error shows when I add the java.mail.jar .
Below is a picture summarising all the story :

Related

How to upload a file in Katalon

So I want the automated test case to find the file and upload it. This is what I found with my research but no luck with it.
WebUI.openBrowser('C:\\\\Users\\\\User\\\\Desktop\\\\Katalon Articles\\\\File Upload\\\\UploadFile.html')
'Maximize the window\r\n'
WebUI.maximizeWindow()
'Uploading the File using Send Keys method by passing the File path'
WebUI.sendKeys(findTestObject('Upload File'), 'C:\\\\Users\\\\Public\\\\Pictures\\\\Sample Pictures\\\\Desert.jpg')
'Capturing the file name after upload and storing it in a variable'
FilePath = WebUI.getAttribute(findTestObject('Upload File'), 'value')
'Verifying the Actual path and Expected path of file'
WebUI.verifyMatch(FilePath, 'C:\\fakepath\\Desert.jpg', false)

Sending Email in Sugarcrm takes long time

When I am trying to send an email with the attachment it gives the below error. We are using SugarCRM Community Edition 6.5 hosted on Local Server. Using Gmail.
Warning: mime_content_type() [function.mime-content-type]: File or
path not found
'cache/modules/Emails/1/6bbf0a1c-c58b-a96e-6759-576ecd00f639' in
C:\xampp\htdocs\SugarCrm\modules\Emails\Email.php on line 335
Warning: mime_content_type() [function.mime-content-type]: File or path not found
'cache/modules/Emails/1/6bbf0a1c-c58b-a96e-6759-576ecd00f639' in
C:\xampp\htdocs\SugarCrm\modules\Emails\Email.php on line 335
{"composeLayoutId":"composeLayout0"}
Lines at 335 are
function sendEmailTest($mailserver_url, $port, $ssltls, $smtp_auth_req, $smtp_username, $smtppassword, $fromaddress, $toaddress, $mail_sendtype = 'smtp', $fromname = '') {
global $current_user,$app_strings;
Thanks
These are only warnings.
Before sending email please try to verify the Email Settings and also send test email from Email Settings page.

phpexcel save file to server ubuntu

I'm with a problem I would like to share to see if I can provide help.
PHP Excel use Ubuntu and want guaradar the file generated in a specific folder of my project directory. I understand that looking information is made as follows, but it is not working properly.
My code is as follows:
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
//header('Content-Disposition: attachment;filename="ReporteSuscriptores.xlsx"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
//$objWriter->save('nameoffile.xls');
$filename = (__DIR__);
$objWriter->save($filename . '/report.xlsx');
Try other alternatives without success as the next block
$objWriter->save('nameoffile.xls');
And I can not save the file generated excel in a specific directory

Display HTML page inside mail body with Email-ext plugin

I'm facing a little problem using Email-ext plugin on Jenkins.
I added the following line to inject my surefire html result to the email sent by the plugin :
${FILE,path="server/target/site/surefire-report.html"}
and I put contenant type as HTML (text/html)
I'm using Jenkins 1.651.1 and Email-ext plugin 2.42
I receive an e-mail in the end of my build with the following contenent
${FILE,path="server/target/site/surefire-report.html"}
It's like the plugin did not understand any thing.
Do you have an idea ?
any update on that ?
my project structure is like this :
workspace
master
commun
server/target/surefire-report/surefire-report.html
If you use a custom path this answer is for you
I had a complication trying to achieve this result because my path was dynamically changing and I had to use a variable inside a FILE variable. So when I tried any of the following
body: '${FILE,path=${report}}'
body: "${FILE,path=${report}}"
body: '''${FILE,path=${report}}'''
and many more, it didn't work. On the other hand I couldn't read the file with groovy because of Jenkins restrictions
My workaround was to read the html directly with groovy sh command like so
html_body = sh(script: "cat ${report}", returnStdout: true).trim()
and then just send the email
emailext replyTo: '$DEFAULT_REPLYTO',
subject: "subject",
to: EMAIL,
mimeType: 'text/html',
body: html_body
where ${report} was a path to html file like /var/jenkins/workspace_318/report.html
Please note that file path is relative to the workspace , if file resides in the root of your workspace , filename alone in the path will work , if it resides in a different location try somthing like this below :
${FILE,path="target/surefire-reports/emailable-report.html"}
I was also having the prob where the mail had the command with error coould not find file. Like mentioned above, the html file should be present exactly under the jenkins workspace folder. if not then give the relative path, even an extra "/" in front seems to throw error.
ex:
My file is in C:\CICDJenkins\ReadyAPIReport\summary.html
My jenkins workpace (im using custom workspace) is C:\CICDJenkins
what worked for me is:
${FILE, path="ReadyAPI_report/overview-summary.html"}

MongoDB - eclipse

I need to create a server-side app that saving information to a mongoDB ,
I'm working with java-eclipse-IDE and i have some problems with that .
First ,
I download the mongo-2.7.2.jar and add it to the path ( project ->properties-> java build path -> add jar -> (adding the mongo-2.7.2.jar file ) .
When I press "Run" without writing any other line except the empty - class & main function
The console writing me that :
CLI (1) [java application] path date
Usage : [--bucket bucketname] action
where action is one of:
list : lists all files in the store
put filename : puts the file filename into the store
get filename1 filename2 : gets filename1 from store and sends to filename2
md5 filename : does an md5 hash on a file in the db (for testing)
I tried to put a system.out.print("indications") in the main function but the console showing me the same output ...
onother interesting fact is when i'm wrting a code using a mongo DB the compiler accepted the code and not throwing errors ( seems he accepted the mongo-2.7.2.jar ).
second ,
I thoght maby i need to install a mongoDB plugin to eclipse , should i?
third ,
I saw that maven is integrated a mongoDB service , is it right that i should download maven to eclipse for handle mongoDB?
I need help soon as possible ....
Thanks.
Sounds like its trying to do something with GridFS but is missing a bucket name... are you using GridFS?