Thanks Greyelf. I am using Mandrillapi because I don't have my own email server. I have these codes to use with the mandrillapi:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
function sendEmail() {
$.ajax({
type: "POST",
url: "
https://mandrillapp.com/api/1.0/messages/send.json",
data: {
"key": "xxxxx",
"message": {
"from_email": "fxxxx",
"to": [{ email: "xxxxx", type: "to" }],
"cc": [{ email: document.getElementById('mail').value, type: "cc" }],
"autotext": "true",
"subject": "Your Profile",
"html": "Thank you for completing this survey" }
}
}).done(function (response) {
var success = response[0] && response[0].status == "sent";
if (success) {
console.log("success")
} else {
console.log(response)
}
});}
</script>
I have also a prompt on the previous passage :
<div id = "mail">(set: $email to (prompt: "Please enter your email address:", ""))
but it doesn't work. I put the script within the javascript story but it throws an error. When I put it in the passage, it doesn't throw any error.
Am I accessing the value of the email correctly? Do you know why it isn't working?
Thank you