View/Edit #560:tell_www_body

Switch to edit mode.

Name(s): tell_www_body
1:  "Copied from Generic Feedback Form (#559):tell_www_body by Dax (#789) Mar 24 07:51:25 2003"
2:  caller == this || raise(E_PERM)
3:  if (iobjstr && player.referer && $www:previous_object() != this)
4:    "We have an unknown form refering a command to us to send mail..."
5:    $msg:mtell("www_error", "Warning!  Previous page doesn't appear to be this one!")
6:    player:tell("For security reasons the mail will not be sent.  Refering page: [", player.referer, "]")
7:    iobjstr = ""
8:  endif
9:  if (!iobjstr)
10:   {name, mail} = player.user == $no_one ? {"", ""} | {$string_utils:nn(player.user), player.user.email_address}
11:   for line in (this.description)
12:     player:tell(strsub(strsub(line, "$1", name), "$2", mail))
13:   endfor
14:   return
15: endif
16: mail_from = tostr($www:parse_POST("email") || "[Unknown]")
17: mail_subj = $string_utils:nn(this)
18: "try"
19: "  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))} | {}};"
20: "except (E_INVARG)"
21: "  \"oops, luser disconnected before he even got the 'sending email' sent to him. what a luser.\";"
22: "  \"fine, I'll just not honor his send then? feel free to change this behavior if you like -- Cecil\";"
23: "  return;"
24: "endtry"
25: mail_text = {}
26: for x in (iobj)
27:   mail_text = {@mail_text, x[1] + ":", @x[2]}
28: endfor
29: player:tell("Sending e-mail...<BR>")
30: for mail_to in (this:_get_email_address())
31:   if (mail_to = $su:trim(mail_to))
32:     "    if (mail_to == \"wizzen@moo.ca\")"
33:     "      error = $network:raw_sendmail(mail_to, \"Date: \" + $time_utils:rfc1123_time(time()), \"From: \" + mail_from, \"To: \" + mail_to, \"Subject: \" + mail_subj, \"\", @mail_text);"
34:     "    else"
35:     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)
36:     "    endif"
37:     if (error)
38:       $msg:mtell("www_error", error)
39:       return player:tell("An error has occured, please mail <A HREF=\"mailto:", $network.postmaster, "\">", $network.postmaster, "</A> and tell them that an out-bound email failed.  Thank-you.")
40:     endif
41:   endif
42:   suspend(0)
43: endfor
44: player:tell("Done.<P>")
45: player:sub_tell(this.msg_confirm)
46: "Last modified by Cecil (#7407) on Mon Mar 24 08:00:18 2003 MST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

[home | help | who | search | setup | code]