X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=demo%2Fclient%2Fmail.php;h=6b6abd4431a3cd18027f752fbe4195b2dc4e42c6;hb=5b0b061574fa8458d5a92c24c20d077ad832cf63;hp=f73ed377f15715ff5810f28eec11e4e2f7944fd2;hpb=26ac91603dc5dab166667622bbc5e7de6d585f3c;p=plcapi.git
diff --git a/demo/client/mail.php b/demo/client/mail.php
index f73ed37..6b6abd4 100644
--- a/demo/client/mail.php
+++ b/demo/client/mail.php
@@ -1,71 +1,83 @@
xmlrpc
Mail demo
+
This form enables you to send mail via an XML-RPC server. For public use
-only the "Userland" server will work (see Dave Winer's message).
-When you press Send this page will reload, showing you the XML-RPC request sent to the host server, the XML-RPC response received and the internal evaluation done by the PHP implementation.
+ only the "Userland" server will work (see Dave Winer's
+ message).
+ When you press Send this page will reload, showing you the XML-RPC request sent to the host server, the
+ XML-RPC response received and the internal evaluation done by the PHP implementation.
+
You can find the source to this page here: mail.php
-And the source to a functionally identical mail-by-XML-RPC server in the file server.php included with the library (look for the 'mail_send' method)
+ And the source to a functionally identical mail-by-XML-RPC server in the file server.php included with the library (look for the 'mail_send'
+ method)
addParam(new xmlrpcval($HTTP_POST_VARS["mailto"]));
- $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailsub"]));
- $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailmsg"]));
- $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailfrom"]));
- $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailcc"]));
- $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailbcc"]));
- $f->addParam(new xmlrpcval("text/plain"));
+ if ($HTTP_POST_VARS["server"] == "Userland") {
+ $XP = "/RPC2";
+ $XS = "206.204.24.2";
+ } else {
+ $XP = "/xmlrpc/server.php";
+ $XS = "pingu.heddley.com";
+ }
+ $f = new xmlrpcmsg('mail.send');
+ $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailto"]));
+ $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailsub"]));
+ $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailmsg"]));
+ $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailfrom"]));
+ $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailcc"]));
+ $f->addParam(new xmlrpcval($HTTP_POST_VARS["mailbcc"]));
+ $f->addParam(new xmlrpcval("text/plain"));
- $c=new xmlrpc_client($XP, $XS, 80);
- $c->setDebug(2);
- $r=&$c->send($f);
- if (!$r->faultCode()) {
- print "Mail sent OK
\n";
- } else {
- print "";
- print "Mail send failed
\n";
- print "Fault: ";
- print "Code: " . htmlspecialchars($r->faultCode()) .
- " Reason: '" . htmlspecialchars($r->faultString()) . "'
";
- print "
";
- }
+ $c = new xmlrpc_client($XP, $XS, 80);
+ $c->setDebug(2);
+ $r = &$c->send($f);
+ if (!$r->faultCode()) {
+ print "Mail sent OK
\n";
+ } else {
+ print "";
+ print "Mail send failed
\n";
+ print "Fault: ";
+ print "Code: " . htmlspecialchars($r->faultCode()) .
+ " Reason: '" . htmlspecialchars($r->faultString()) . "'
";
+ print "
";
+ }
}
?>
-
-$Id$