Sending email (outlook) with javascript

0

I found a code that makes Outlook open, but when I enter it into my code it does not work.

BELOW THE CODE THAT I WILL FIND

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<div id="mailBody"><table border=1> <tr><td>blabla</td></tr> </table></div>
<input type="tex" name="email" id="email">
<input type="tex" name="email2" id="email2">
<textarea name="teste"></textarea>
<input type="button" onclick="SendEmail();">

<script type="text/javascript">
    function SendEmail(){
    var outlookApp = new ActiveXObject("Outlook.Application");
    var nameSpace = outlookApp.getNameSpace("MAPI");
    mailFolder = nameSpace.getDefaultFolder(6);
    mailItem = mailFolder.Items.add('IPM.Note.FormA');
    mailItem.Subject = "Me";
    mailItem.To = email.value + ";" + email2.value;
    mailItem.HTMLBody = teste.value;
    mailItem.display(0);
    }
</script>
</html>

NOW MY CODE

<textarea name="textarea1" id="textarea1" rows="5" cols="40" id="salvar"></textarea>
        <input name="save" type="button" value="ADD CONTEINER"
           onclick="saveValues(); return false"/>
        &#0160;
        <input type="button" value="Enviar e-mail (outlook)" onclick="SendEmail(); return false">

function SendEmail(){
        var outlookApp = new ActiveXObject("Outlook.Application");
        var nameSpace = outlookApp.getNameSpace("MAPI");
        mailFolder = nameSpace.getDefaultFolder(6);
        mailItem = mailFolder.Items.add('IPM.Note.FormA');
        mailItem.Subject = "Novo pedido";
        mailItem.To = email_pag1.value;
        mailItem.HTMLBody = textarea1.value;
        mailItem.display(0);
    }

I do not understand why it's not working!

    
asked by anonymous 13.02.2017 / 15:35

0 answers