ID:138092
 
Well, we need a DMCGI email method somehow...

For example, let's take a hypothetical situation. Some guy named, oh, let's say, Spuzzy, is trying to make a webpage for his BYOND website at, er, spuzzy.byond.com. So this Spuzzy guy decides that he wants to have one of his pages with a nice email form so users can send him email without having to go through their most likely blocky and useless free email servers.

So Spuzzy is SOL, eh?



Why put off till tomorrow what you can do today? -- Scribbled above a urinal
On 4/17/01 10:15 pm Spuzzum wrote:
Well, we need a DMCGI email method somehow...
So Spuzzy is SOL, eh?

Feh...it's called BYOND CGI and using the UNIX mail command. The upcoming DDT email engine does this all the time, and even sends attachments. I was thinking about adding it to the next version of the Deadron library (which someday I should bother documenting and putting up):


SendEmail(address, subject, message, attachment_path)
// Write the message to a file, then email it.
var/message_filename = ckey("email[address][rand(1, 5001)][world.realtime].txt")
var/message_file = file(message_filename)
message_file << message

var/command
if (attachment_path)
// Use mpack for MIME attachment handling.
command = "mpack -s \"[subject]\" -d [message_filename] [attachment_path] [address]"
shell(command)
else
command = "mail -s \"[subject]\" [address] < [message_filename]"
shell(command)

// Remove the file.
fdel(message_filename)
return