@verb #560:"tell_www_body" this none this rxdo #789
@program #560:"tell_www_body" this none this
"Copied from Generic Feedback Form (#559):tell_www_body by Dax (#789) Mar 24 07:51:25 2003"
caller == this || raise(E_PERM)
if (iobjstr && player.referer && $www:previous_object() != this)
"We have an unknown form refering a command to us to send mail..."
$msg:mtell("www_error", "Warning! Previous page doesn't appear to be this one!")
player:tell("For security reasons the mail will not be sent. Refering page: [", player.referer, "]")
iobjstr = ""
endif
if (!iobjstr)
{name, mail} = player.user == $no_one ? {"", ""} | {$string_utils:nn(player.user), player.user.email_address}
for line in (this.description)
player:tell(strsub(strsub(line, "$1", name), "$2", mail))
endfor
return
endif
mail_from = tostr($www:parse_POST("email") || "[Unknown]")
mail_subj = $string_utils:nn(this)
"try"
" mail_text = {\"Logged in as: \" + $su:nn(player.user), \"User-Agent: \" + player.user_agent, @this.log_ips ? {\"Connection-Name: \" + $string_utils:connection_hostname(connection_name(player))} | {}};"
"except (E_INVARG)"
" \"oops, luser disconnected before he even got the 'sending email' sent to him. what a luser.\";"
" \"fine, I'll just not honor his send then? feel free to change this behavior if you like -- Cecil\";"
" return;"
"endtry"
mail_text = {}
for x in (iobj)
mail_text = {@mail_text, x[1] + ":", @x[2]}
endfor
player:tell("Sending e-mail...
")
for mail_to in (this:_get_email_address())
if (mail_to = $su:trim(mail_to))
" if (mail_to == \"wizzen@moo.ca\")"
" error = $network:raw_sendmail(mail_to, \"Date: \" + $time_utils:rfc1123_time(time()), \"From: \" + mail_from, \"To: \" + mail_to, \"Subject: \" + mail_subj, \"\", @mail_text);"
" else"
error = $network:raw_sendmail(mail_to, "Date: " + $time_utils:rfc1123_time(time()), "From: feedback@moo.ca", "Reply-To: " + mail_from, "To: " + mail_to, "Subject: " + mail_subj, @mail_text)
" endif"
if (error)
$msg:mtell("www_error", error)
return player:tell("An error has occured, please mail ", $network.postmaster, " and tell them that an out-bound email failed. Thank-you.")
endif
endif
suspend(0)
endfor
player:tell("Done.
") player:sub_tell(this.msg_confirm) "Last modified by Cecil (#7407) on Mon Mar 24 08:00:18 2003 MST." .