Move examples to own file
authorkristianf <devnull@localhost>
Wed, 13 Aug 2014 18:58:58 +0000 (20:58 +0200)
committerkristianf <devnull@localhost>
Wed, 13 Aug 2014 18:58:58 +0000 (20:58 +0200)
examples.txt [new file with mode: 0644]

diff --git a/examples.txt b/examples.txt
new file mode 100644 (file)
index 0000000..dc93a7a
--- /dev/null
@@ -0,0 +1,46 @@
+   * Example of usage:
+   * <?
+   *  header("Content-type: text/plain");
+   *  require("emailclass.php");
+   *  $a = new sendmail;
+   *  $a->from("noreply@kfwebs.net");
+   *  $a->add_to("@kfwebs.net");
+   *  $a->add_cc("user1@kfwebs.net");
+   *  $a->add_bcc("user2@kfwebs.net");
+   *  $a->subject("This is the subject - blah");
+   *  $a->body("This is a test\n\n");
+   *  $a->body("This is another line");
+   *  $a->gpg_set_key("test2");
+   *  $a->gpg_set_algo("twofish"); //default to AES256 if omitted
+   *  $a->attachment("/webs/development/WhoWroteSobig.pdf");
+   *  if($a->send()) echo "Mail sent"; 
+   * ***************************************************************
+   * If you want to use asymmetrical encryption instead 
+   * (Public Key Infrastructure) you will have to configure a keyring
+   * manually. Then you can use:
+   * $a->gpg_add_key("6b0b9508");
+   * $a->gpg_add_key("789ABCDE");
+   * $a->gpg_set_type(GPG_ASYMMETRIC);
+   * $a->gpg_set_homedir("/webs/development/.gnupg/");
+   * instead. now gpg_set_key is the keys to use and not the password, 
+   * GPG_ASYMMETRIC is a constant to 2, the constant GPG_SYMMETRIC is 1,
+   * but rarely used as it is the default.
+   * 
+   * To use the sign feature you have to set $a->gpg_set_sign(1); this 
+   * require a default key to be defined in the gpg.conf, using a line 
+   * such as default-key  4336E0CB
+   * ***************************************************************
+   * To sign outgoing messages: 
+   * $a = new sendmail_gpgsign;
+   * $a->from("kf@kfwebs.net");
+   * $a->add_to("webmaster@kfwebs.net");
+   * $a->subject("This is the subject - blah");
+   * $a->body("This is a test\n\n");
+   * $a->body("This is another line");
+   * $a->gpg_set_signing_key("0x4336E0CB");
+   * $a->gpg_set_algo("sha512"); // default to sha256
+   * $a->gpg_set_homedir("/webs/development/.gnupg/");
+   * $a->gpg_set_key("6b0b9508");
+   * $a->attachment("/webs/development/img_2670.jpg");
+   * if($a->send()) echo "Mail sent"; 
+