Guest User

Untitled

a guest
Aug 3rd, 2020
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local ScriptId = "" --paste the ScriptId of your web app URL here
  2.  
  3. local Url = "https://script.google.com/macros/s/" .. ScriptId .. "/exec" --creating the url from the ScriptId
  4. local HttpService = game:GetService("HttpService")
  5.  
  6. local Module = {}
  7.  
  8. function Module:SendEmail(Email, Subject, Message) --Email address of the recipient, Subject of message, Body of message
  9.     local Success, ErrorStatement  = pcall(function()
  10.         Result = HttpService:GetAsync(Url .. "?q="..game.HttpService:JSONEncode({Email, Subject, Message})) --Result will either return true if the Email was sent successfully, or an error message string explaining what went wrong, if it failed to send.
  11.     end)
  12.     if Success then
  13.     return Result
  14.     else
  15.         return ErrorStatement
  16.     end
  17. end
  18.  
  19. return Module
Add Comment
Please, Sign In to add comment