diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/README.md b/README.md index 822b364..51ce099 100644 --- a/README.md +++ b/README.md @@ -1 +1,55 @@ # interns-assignments +completed by: shatakshi shrivastava +Project Title +Challenge1: +Write a program to programmatically trigger an email. + +The program must be able to send an email to “hr@ignitershub.com”. + +The Subject of the email Should mention “Challenge 3 Completed”. + +The body of the email should contain: + +Your name, semester, branch, and roll number +An image attachment. (Only images of type PNG, JPG, JPEG are allowed.) +During the development, please use your personal email id to test the program. + +Deployment +To deploy this project +run the following commands in the ternimal: +npm i +cd src +node challenge1.js + +challenge 2 – Palindrome Checker +Write a program that checks whether a given string is a palindrome or not. A +palindrome is a word, phrase, or sequence of characters that reads the same +backwards as forward. + +Language:- Any (i.e. Java, C, C++, JavaScript, Python, etc.). However, preferred is Java. + +Your program should prompt the user to enter a string, and then it should determine and +display whether the input string is a palindrome or not. + +Deployment +To deploy this project simply run it in browser. + +challenge 3 – Binary Search +Write a program that implements the binary search algorithm to search for a +specific element in a sorted array. The program should allow the user to input a +target element and then search for that element in the sorted array. It should +return the index of the element if found or indicate that the element is not in +the array. + +Language:- Any (i.e. Java, C, C++, JavaScript, Python, etc.). However, preferred is Java. +Deployment +To deploy this project simply run it in browser. + +Challenge 4 – String Manipulation +Write a program that takes a sentence as input and performs the following +operations: +1.Count the number of words in the sentence. +2.Reverse the order of words in the sentence. +3.Replace all spaces with hyphens ('-'). + +Language:- Any (i.e. Java, C, C++, JavaScript, Python, etc.). However, preferred is Java. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..1dd72ee --- /dev/null +++ b/package-lock.json @@ -0,0 +1,24 @@ +{ + "name": "delete-assignment", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "delete-assignment", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "nodemailer": "^6.9.13" + } + }, + "node_modules/nodemailer": { + "version": "6.9.13", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.13.tgz", + "integrity": "sha512-7o38Yogx6krdoBf3jCAqnIN4oSQFx+fMa0I7dK1D+me9kBxx12D+/33wSb+fhOCtIxvYJ+4x4IMEhmhCKfAiOA==", + "engines": { + "node": ">=6.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..872c89d --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "assignment", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "nodemailer": "^6.9.13" + } +} diff --git a/src/attachment.png b/src/attachment.png new file mode 100644 index 0000000..5249034 Binary files /dev/null and b/src/attachment.png differ diff --git a/src/challenge1.js b/src/challenge1.js new file mode 100644 index 0000000..e28652e --- /dev/null +++ b/src/challenge1.js @@ -0,0 +1,35 @@ +const nodemailer = require("nodemailer"); + +const transport = nodemailer.createTransport({ + host: "smtp-relay.brevo.com", + port: 587, + secure: false, + auth: { + user: "76c643001@smtp-brevo.com", + pass: "n4NQS6Td5mOwFWr7", + }, +}); + +const mailOptions = { + from: "shatakshishri@gmail.com", + to: "hr@ignitershub.com", + subject: "Challenge 3 Completed", + text: `Name: Shatakshi Shrivastava + Semester: 8th + Branch: Electronics and Communications + Roll Number: 12015119 + `, + attachments: [ + { + filename: "attachment.png", + path: "./attachment.png", + }, + ], +}; + +async function sendMail(){ + const result = await transport.sendMail(mailOptions) + console.log(result); +} + +sendMail() diff --git a/src/challenge2/index.html b/src/challenge2/index.html new file mode 100644 index 0000000..5c92a67 --- /dev/null +++ b/src/challenge2/index.html @@ -0,0 +1,11 @@ + + +
+ + +