Welcome to the Protogrid Developer Wiki. A place to gather all the documentation and tips&tricks regarding Protogrid.


This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
protogrid:json_api_endpoint_mailsend [2020-12-22 16:03]
dru Hier gelöscht, da zwecks Konsistenzerhaltung in Haupt-Endpoint-Arikel (https://protogrid.wiki/protogrid/api_endpoints#apiv2appsapp_nameprotosproto_keycard-keys) übernommen
— (current)
Line 1: Line 1:
-====== JSON API Endpoint mailsend ====== 
-[GET, POST] Send an email using the provided data 
-The following JSON data fields or URL parameters can be used: 
-  * to: TO address (multiple addresses separated by comma) 
-  * cc: CC address (multiple addresses separated by comma) 
-  * bcc: BCC address (multiple addresses separated by comma) 
-  * replyto: ReplyTo address 
-  * subject: Subject in plain text 
-  * body: Body text in plain text format (URL encoded) 
-  * bodyhtml: Body text in HTML format (URL encoded). If both body and bodyhtml are specififed, only bodyhtml will be used 
-  * attachments: weblink to attachment (URL encoded), multiple links separated by comma 
-Combinations of JSON data fields and URL parameters are allowed, whereas JSON data fields take precendence over URL parameters 
-The mail will be sent according to the currently logged in user (mail address specified in user profile, and the fields "SMTP Server Hostname", "SMTP Server Port" and "SMTP Server Password"). 
-The function will fist try to establish a TLS session to the specified mail server and authenicate using the supplies credentials. If TLS is not available it will try to connect using SSL. Finally if SSL is not available the function tries to connect using unsecured SMTP protocol. 
-The returned result will contain the key success with a value of true or a corresponding error message. 
-Example request:  
-Example result: 
-<code json> 
-   "errors" : [], 
-   "protogrid_environment_version" : "2.1.3", 
-   "result": {"success":true} 
-==== Example client-side jQuery function to send mail in web application ==== 
-<code json> 
-$.get("https://example.protogrid.com/api/v2/apps/example/mailsend?to=user@example.com&subject=Test&body=This%20is%20a%20testmessage", function(data, status){ 
-    alert("Data: " + JSON.stringify(data)); 
-  }); 
-    url: "https://example.protogrid.com/api/v2/apps/example/mailsend", 
-    data: JSON.stringify({ 
- "to": "user@example.com", 
- "cc": "user2@example.com", 
- "subject": "Test", 
- "body": "This%20is%20a%20testmessage", 
- }), 
-    contentType: 'application/json; charset=utf-8' 
-}).done(function (response) { 
-        alert("Data: " + JSON.stringify(response));