Created
February 12, 2018 21:06
-
-
Save paschmann/144fea92015428bd773adfee290ca637 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//XSJS File | |
function sendUserEmail() { | |
try { | |
var from = "[email protected]"; | |
var to = $.request.parameters.get("email"); | |
var subject = $.request.parameters.get("subject"); | |
var message = $.request.parameters.get("message"); | |
var mail = new $.net.Mail({ | |
sender: {address: from}, | |
to: [{ address: to}], | |
subject: "Subject : "+subject+" ", | |
subjectEncoding:"UTF-8", | |
parts: [ new $.net.Mail.Part({ | |
type: $.net.Mail.Part.TYPE_TEXT, | |
contentType: "text/plain", | |
text: message, | |
encoding:"UTF-8" | |
})] | |
}); | |
var returnValue = mail.send(); | |
var response = "MessageId = " + returnValue.messageId + ", final reply = " + returnValue.finalReply; | |
$.response.setBody(JSON.stringify(response)); | |
} | |
catch (e) { | |
Dataset.response = e.message + " "; | |
} | |
} | |
//XSHTTPDEST File | |
description = "SMTP Email Account"; | |
host = "localhost"; | |
port = 25; | |
proxyType = http; | |
proxyHost = "proxy"; | |
proxyPort = 8080; | |
authType = basic; | |
useSSL = true; | |
timeout = 0; | |
sslHostCheck = true; | |
sslAuth = anonymous; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment