RobloxGmail - Send Emails through Gmail using a Google Apps Script Web App

Mhm! So the Google Apps Script and the chat script I am using?
Edit: I sent it now!

2 Likes

Its awesome!! I never thought about it… I readed that its even possible to make http request and stuff… But I never tried it… yet. I consider you a talented genius, everything looks easy for you, I will always follow ur stuff :+1:

1 Like

Wow, I am already seeing how I could use this. This is just really great. Thanks for this amazing tutorial!

1 Like

Why would people want to send an Email ingame?

1 Like
1 Like

Idk if it’s written here, but is it possible the main script (the one that actually sends the email) being Local Script?

No it actually can’t be executed so ye.

You couldn’t use this module from a LocalScript, because HttpService requests only work from the Server. However, you could use a RemoteEvent to tell the Server to send a email.

If LocalScript use of requests was available, it would be very bad since exploiters could use up all of your game’s requests from their client, and possibly break your game.

This isnt working for me, I read it several times.

My script, using the module:

 local RobloxGmail = require(script.Parent)

local Output = RobloxGmail:SendEmail("@email.com","subject text","body text")  --Email address of the recipient, Subject of message, Body of message

print(Output)

my module script:

local ScriptId = "" --paste the ScriptId of your web app URL here

local Url = "https://script.google.com/macros/s/" .. ScriptId .. "/exec" --creating the url from the ScriptId
local HttpService = game:GetService("HttpService")

local Module = {}

function Module:SendEmail(Email, Subject, Message) --Email address of the recipient, Subject of message, Body of message
	local Success, ErrorStatement  = pcall(function()
		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.
	end)
	if Success then
		return Result
	else
		return ErrorStatement
	end
end

return Module

in actual code i have filled in my script id, and my email, and I have double checked if I did it correctly 5 times, and its still not working, maybe it takes a hour for google web apps to process it, so you can actually use it

I’m also getting no errors ( charssss )

This could be very usefull for if you have a game and you want to send like the answers that the players put in somewhere and it would unlock some other posibilities, great job on making this and thanks for sharing this with the community!

Sorry this isn’t working for you. I’ve DMed you so we can hopefully figure out what is going on.

i have a error SyntaxError: Unexpected token u in JSON at position 0 (line 4, file “Code”)

Is this error coming from your Google Apps Script or Roblox end? Can you send me the code you’re using in DMs so I can see what’s going on?

1 Like

i fixed it i just opened it in my browser to see what will happen

1 Like

Hi @ExcessEnergy !

I think it is a great tutorial, but everytime I try it gives me "HTTP 404(Not Found) , could you help me ?

edit : I executed it on browser and it displays this : “SyntaxError: Unexpected token u in JSON at position 0 (ligne 4, file “Code”)”

Totally awesome, great tutorial! :clap:

Sorry for the late response. I have DMed you so that we can hopefully find a solution!

Hey there, its an awesome tutorial. Thanks for the help you’re providing us.

That’s quite a long (possibly error) message am receiving.
would love your help thanks!

12:46:26.028 Errorbody {background-color: #fff; margin: 0; padding: 0;}.errorMessage {font-family: Arial,sans-serif; font-size: 12pt; font-weight: bold; line-height: 150%; padding-top: 25px;}

Google Apps Script
Script function not found: doGet
- Server - Script:7