CalebN99
CalebN99

Reputation: 99

Sending email using mailto: won't fill subject field

Using the Window.open mailto: to send an email from my app. It opens up the email software and fills in whoever is being emailed just fine, but I can't seem to fill in the subject field.

  methods: {
    email: function(event) {
      let mail =
        "mailto:[email protected]?" +
        "&subject=" +
        escape("This is my subject");
      window.location.href = mail;
    }
  }

Upvotes: 0

Views: 137

Answers (1)

epascarello
epascarello

Reputation: 207527

It should not have the & if it is the only parameter

methods: {
  email: function(event) {
    let mail =
      "mailto:[email protected]?" +
      "subject=" +
      encodeURIComponent("This is my subject");
    window.location.href = mail;
  }
}

Upvotes: 2

Related Questions