| version 1.1, 2002/09/29 22:34:34 |
version 1.2, 2002/10/21 13:39:49 |
| Line 2 Libsmtp - A simple SMTP library (C)opyri |
|
| Line 2 Libsmtp - A simple SMTP library (C)opyri |
|
| |
|
| Introduction |
Introduction |
| |
|
| Libsmtp is a small, simple library that allows you to easily send email with SMTP. |
Libsmtp is a small, simple library that allows you to easily send email with |
| The API is small & clean, and the library does not rely on any other libraries other |
SMTP. The API is small & clean, and the library does not rely on any other |
| than Glibc. |
libraries other than Glibc. |
| |
|
| Libsmtp was originally written as part of the Whisper mail client for the AtheOS |
Libsmtp was originally written as part of the Whisper mail client for the |
| operating system, but has been tested and is known to compile & work on both AtheOS |
AtheOS operating system, but has been tested and is known to compile & work on |
| 0.3.7, and Linux Mandrake 8.0 Other versions of Linux are expected to work. |
both AtheOS 0.3.7, and Linux Mandrake 8.0 Other versions of Linux are expected |
| |
to work. |
| |
|
| You can contact me at vanders@cableinet.co.uk, and you can check for new versions of |
You can contact me at vanders@cableinet.co.uk, and you can check for new |
| libsmtp on my webpage at http://www.shagged.org/~vanders/ |
versions of libsmtp on my webpage at http://www.shagged.org/~vanders/ |
| |
|
| License |
License |
| |
|
| Libsmtp is distributed under the GNU Lesser General Public License, and is Copyright |
Libsmtp is distributed under the GNU Lesser General Public License, and is |
| 2001-2002 Kristian Van Der Vliet. Please see the file COPYING, included with |
Copyright 2001-2002 Kristian Van Der Vliet. Please see the file COPYING, |
| Libsmtp, for more information. Alternatively, you can visit the GNU website at |
included with Libsmtp, for more information. Alternatively, you can visit the |
| http://www.gnu.org |
GNU website at http://www.gnu.org |
| |
|
| Building & Installing |
Building & Installing |
| |
|
| Libsmtp can be built as either a static (.a) or shared (.so) library, and the |
Libsmtp can be built as either a static (.a) or shared (.so) library, and the |
| Makefile includes targets for both. By default Libsmtp is built as a static library. |
Makefile includes targets for both. By default Libsmtp is built as a static |
| |
library. |
| |
|
| To build libsmtp as a static library, enter the following commands: |
To build libsmtp as a static library, enter the following commands: |
| |
|
| Line 33 To build libsmtp as a shared library, en |
|
| Line 35 To build libsmtp as a shared library, en |
|
| |
|
| bash$ make shared |
bash$ make shared |
| |
|
| If you build libsmtp as a static library, you can copy the libsmtp.a & inc/libsmtp.h |
If you build libsmtp as a static library, you can copy the libsmtp.a & |
| files to wherever you wish (In most cases, this will be in your project working |
inc/libsmtp.h files to wherever you wish (In most cases, this will be in your |
| directory). If you build libsmtp as a shared library, you should also run "make |
project working directory). If you build libsmtp as a shared library, you |
| install". The shared object libsmtp.so is copied to /usr/lib/ and the header file |
should also run "make install". The shared object libsmtp.so is copied to |
| inc/libsmtp.h is copied to usr/includes/ |
/usr/lib/ and the header file inc/libsmtp.h is copied to usr/includes/ |
| |
|
| Using libsmtp |
Using libsmtp |
| |
|
| For information on the libsmtp API, please see the file API, which is included with |
For information on the libsmtp API, please see the file API, which is included |
| libsmtp. |
with libsmtp. |
| |
|
| Compiling with libsmtp depends on wether you are using the static or the shared |
Compiling with libsmtp depends on wether you are using the static or the shared |
| library. If you are using the shared library, you can build a project by including |
library. If you are using the shared library, you can build a project by |
| -lsmtp in your GCC flags. For example: |
including -lsmtp in your GCC flags. For example: |
| |
|
| bash$ gcc myproject.c -lsmtp -o myproject |
bash$ gcc myproject.c -lsmtp -o myproject |
| |
|
| Will link your code against libsmtp which is in /usr/lib/. |
Will link your code against libsmtp which is in /usr/lib/. |
| |
|
| If you are using the static library, you must also tell GCC the path to the library |
If you are using the static library, you must also tell GCC the path to the |
| object (libsmtp.a). For example, if you have copied libsmtp.a into your project |
library object (libsmtp.a). For example, if you have copied libsmtp.a into |
| directory, in a subdirectory named "libs", you could use: |
your project directory, in a subdirectory named "libs", you could use: |
| |
|
| bash$ gcc myproject.c -L./libs/ -lsmtp -o myproject |
bash$ gcc myproject.c -L./libs/ -lsmtp -o myproject |
| |
|
| You can find more about the GCC flags from the GCC manual page or with the online |
You can find more about the GCC flags from the GCC manual page or with the |
| documentation at http://www.gnu.org |
online documentation at http://www.gnu.org |
| |
|