0

I came across a website and was curious about its available jobs. To my surprise, a popup window asked me to look in the console and enter my email using a function. I did by typing in getStep3('myemail@yahoo.com'). A message appeared saying that in perfect world, they would have finish the JS in which an email will be send. However, they ran out of time and as part of my job application, they want me to email them my solution of how to make getStep3() functional so that it can send them email notification.

All I know is that in html, you use "mailto: email@email.com" in <a> link. So after doing research, is it like this?

function getStep3(emailAddress) {
var link = 'mailto:jobs@company.com?subject=Job application?body= ' + emailAddress + 'wants to apply for a job at your company";
window.location.href = link;
}

UPDATE People said that it's a duplicate of another question. I'm not sure but I don't think it's asking to send an email that you make, but a email notification once someone type in their email and run the function in the Console.

Kristina Bressler
  • 1,642
  • 1
  • 25
  • 60
  • 1
    There's no way to send a mail from JS running in the brother (directly). With your code, you will ask the browser to launch the default mail application with subject/body if supported (and it's probably `&body.....'`, note the & and the single quote) –  Feb 09 '17 at 17:31
  • 1
    Can you please post the url of this apply job web page? – EugenSunic Feb 09 '17 at 17:32
  • 1
    Possible duplicate of [How to send email by using javascript or jquery](http://stackoverflow.com/questions/1415205/how-to-send-email-by-using-javascript-or-jquery) –  Feb 09 '17 at 17:33
  • https://codemyviews.com/ – Kristina Bressler Feb 09 '17 at 17:37
  • *as part of my job application* - so you want us to get you a job? – Matt Burland Feb 09 '17 at 17:54
  • No, I'm not ready to apply for that kind of job with my low javascript skills. I'm studying Javascript right now and was just curious how do one do that. I was a bit confused after doing research, in which one said that it's not possible to send email from JS while others said to use window.location.href to send email... – Kristina Bressler Feb 09 '17 at 18:00
  • Actually, I was just curious about which jobs are available at that company I happened to come across... – Kristina Bressler Feb 09 '17 at 18:02

0 Answers0